From 82711f6567ef069eebb942e382e2c3fa61fbf538 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 1 Aug 2024 14:23:42 +0000 Subject: automatic import of compat-libgfortran-48 --- gcc48-pr69644.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 gcc48-pr69644.patch (limited to 'gcc48-pr69644.patch') diff --git a/gcc48-pr69644.patch b/gcc48-pr69644.patch new file mode 100644 index 0000000..d6731e5 --- /dev/null +++ b/gcc48-pr69644.patch @@ -0,0 +1,51 @@ +2016-02-04 Jakub Jelinek + + Backported from mainline + 2016-02-03 Jakub Jelinek + + PR target/69644 + * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap): + Force oldval into register if it does not satisfy reg_or_short_operand + predicate. Fix up formatting. + + * gcc.dg/pr69644.c: New test. + +--- gcc/config/rs6000/rs6000.c ++++ gcc/config/rs6000/rs6000.c +@@ -20263,6 +20263,9 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[]) + else if (reg_overlap_mentioned_p (retval, oldval)) + oldval = copy_to_reg (oldval); + ++ if (mode != TImode && !reg_or_short_operand (oldval, mode)) ++ oldval = copy_to_mode_reg (mode, oldval); ++ + mem = rs6000_pre_atomic_barrier (mem, mod_s); + + label1 = NULL_RTX; +@@ -20277,10 +20280,8 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[]) + + x = retval; + if (mask) +- { +- x = expand_simple_binop (SImode, AND, retval, mask, +- NULL_RTX, 1, OPTAB_LIB_WIDEN); +- } ++ x = expand_simple_binop (SImode, AND, retval, mask, ++ NULL_RTX, 1, OPTAB_LIB_WIDEN); + + cond = gen_reg_rtx (CCmode); + /* If we have TImode, synthesize a comparison. */ +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr69644.c +@@ -0,0 +1,11 @@ ++/* PR target/69644 */ ++/* { dg-do compile } */ ++ ++int ++main () ++{ ++ unsigned short x = 0x8000; ++ if (!__sync_bool_compare_and_swap (&x, 0x8000, 0) || x) ++ __builtin_abort (); ++ return 0; ++} -- cgit v1.2.3