[adding the list]

On Jun  8, 2017, Uros Bizjak <ubiz...@gmail.com> wrote:

> On Thu, Jun 8, 2017 at 9:22 PM, Alexandre Oliva <aol...@redhat.com> wrote:
>> I was playing with bootstrap STAGE2_C{,XX}FLAGS='-O0 -fcompare-debug' to
>> test some changes I'm working on, and -Werror in stage2 prevented
>> compilation of one of the insn-*.c files.  That's because round<mode>2
>> doesn't have an operand 2.  The generated code for round<mode>2_sfix
>> calls the corresponding gen_round<mode>2, and then something in there
>> attempts to access the uninitialized operand, which the stage1 GCC warns
>> about and errors out because of -Werror.
>> 
>> I'll be glad to test and submit a patch for this, but I thought I'd ask
>> whether you'd prefer to leave this alone, to have it fixed it with a
>> minimal diff as below, or with a renumbering of all operands >=3 to >=2?

> These operands are already pretty weirdly numbered, so the below looks
> appropriate as well.

> The proposed patch is OK.

Thanks, I'm checking this in.  Regstrapped on x86_64-linux-gnu.

[i386] renumber operands to avoid gap

i386's round<mode>2 had a gap at operand 2, and so gen_round<mode>2
attempted to read from the uninitialized operand.  Building stage2
with -O0 errored out, though at higher optimization levels it compiled
successfully.  Fixed by renumbering the last operand into the gap.

for  gcc/ChangeLog

        * config/i386/sse.md (round<mode>2): Renumber operand into gap.
---
 gcc/config/i386/sse.md |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 29a039d..68c4bbe 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -15644,7 +15644,7 @@
          (match_dup 3)))
    (set (match_operand:VF 0 "register_operand")
        (unspec:VF
-         [(match_dup 4) (match_dup 5)]
+         [(match_dup 4) (match_dup 2)]
          UNSPEC_ROUND))]
   "TARGET_ROUND && !flag_trapping_math"
 {
@@ -15668,7 +15668,7 @@
   emit_insn (gen_copysign<mode>3 (operands[3], vec_half, operands[1]));
 
   operands[4] = gen_reg_rtx (<MODE>mode);
-  operands[5] = GEN_INT (ROUND_TRUNC);
+  operands[2] = GEN_INT (ROUND_TRUNC);
 })
 
 (define_expand "round<mode>2_sfix"


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

Reply via email to