[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-30 Thread hjl at gcc dot gnu dot org


--- Comment #16 from hjl at gcc dot gnu dot org  2009-06-30 13:56 ---
Subject: Bug 40493

Author: hjl
Date: Tue Jun 30 13:55:43 2009
New Revision: 149097

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=149097
Log:
2009-06-30  H.J. Lu  hongjiu...@intel.com

Backport from mainline:
2009-06-30  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40582
* gcc.c-torture/compile/pr40582.c: New test.

2009-06-29  Jason Merrill  ja...@redhat.com

PR c++/40274
* g++.dg/template/debug1.C: New.

2009-06-25  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40493
* gcc.c-torture/execute/pr40493.c: New test.

Added:
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/debug1.C
  - copied unchanged from r149095,
trunk/gcc/testsuite/g++.dg/template/debug1.C
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40582.c
  - copied unchanged from r149095,
trunk/gcc/testsuite/gcc.c-torture/compile/pr40582.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr40493.c
  - copied unchanged from r149096,
trunk/gcc/testsuite/gcc.c-torture/execute/pr40493.c
Modified:
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-25 Thread jamborm at gcc dot gnu dot org


--- Comment #14 from jamborm at gcc dot gnu dot org  2009-06-25 10:38 
---
Subject: Bug 40493

Author: jamborm
Date: Thu Jun 25 10:38:13 2009
New Revision: 148941

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148941
Log:
2009-06-25  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40493
* tree-sra.c (sra_modify_expr): Correct BIT_FIELD_REF argument numbers.
(enum unscalarized_data_handling): New type.
(handle_unscalarized_data_in_subtree): Return what has been done.
(load_assign_lhs_subreplacements): Handle left flushes differently.
(sra_modify_assign): Use unscalarized_data_handling, simplified
condition determining whether to remove the statement.

* testsuite/gcc.c-torture/execute/pr40493.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr40493.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-25 Thread jamborm at gcc dot gnu dot org


--- Comment #15 from jamborm at gcc dot gnu dot org  2009-06-25 14:21 
---
I have checked out trunk 148941, compiled binutils with it (configured
with --disable-werror), ran the testsuite and there were no failures.
Thus I consider this fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-24 Thread jamborm at gcc dot gnu dot org


--- Comment #13 from jamborm at gcc dot gnu dot org  2009-06-24 16:38 
---
Fix submitted to the mailing list, pending maintainer approval:
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01918.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-23 Thread jamborm at gcc dot gnu dot org


--- Comment #10 from jamborm at gcc dot gnu dot org  2009-06-23 13:21 
---
The miscompiled file seems to be gas/tc-i386.o.  Early SRA is enough to trigger
the problem.  Digging deeper...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-23 Thread hjl dot tools at gmail dot com


--- Comment #11 from hjl dot tools at gmail dot com  2009-06-23 13:40 
---
(In reply to comment #10)
 The miscompiled file seems to be gas/tc-i386.o.  Early SRA is enough to 
 trigger
 the problem.  Digging deeper...
 

tc-i386.c uses union with bit fields. See opcodes/i386-opc.h
for details.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-23 Thread jamborm at gcc dot gnu dot org


--- Comment #12 from jamborm at gcc dot gnu dot org  2009-06-23 16:45 
---
Reduced testcase:

extern void abort (void);

typedef union i386_operand_type
{
  struct
{
  unsigned int reg8:1;
  unsigned int reg16:1;
  unsigned int reg32:1;
  unsigned int reg64:1;
  unsigned int floatreg:1;
  unsigned int regmmx:1;
  unsigned int regxmm:1;
  unsigned int regymm:1;
  unsigned int control:1;
  unsigned int debug:1;
  unsigned int test:1;
  unsigned int sreg2:1;
  unsigned int sreg3:1;
  unsigned int imm1:1;
  unsigned int imm8:1;
  unsigned int imm8s:1;
  unsigned int imm16:1;
  unsigned int imm32:1;
  unsigned int imm32s:1;
  unsigned int imm64:1;
  unsigned int disp8:1;
  unsigned int disp16:1;
  unsigned int disp32:1;
  unsigned int disp32s:1;
  unsigned int disp64:1;
  unsigned int acc:1;
  unsigned int floatacc:1;
  unsigned int baseindex:1;
  unsigned int inoutportreg:1;
  unsigned int shiftcount:1;
  unsigned int jumpabsolute:1;
  unsigned int esseg:1;
  unsigned int regmem:1;
  unsigned int mem:1;
  unsigned int byte:1;
  unsigned int word:1;
  unsigned int dword:1;
  unsigned int fword:1;
  unsigned int qword:1;
  unsigned int tbyte:1;
  unsigned int xmmword:1;
  unsigned int ymmword:1;
  unsigned int unspecified:1;
  unsigned int anysize:1;
} bitfield;
  unsigned int array[2];
} i386_operand_type;

unsigned int x00, x01, y00, y01;

int main (int argc, char *argv[])
{
  i386_operand_type a,b,c,d;

  a.bitfield.reg16 = 1;
  a.bitfield.imm16 = 0;
  a.array[1] = 22;

  b = a;
  x00 = b.array[0];
  x01 = b.array[1];

  c = b;
  y00 = c.array[0];
  y01 = c.array[1];

  d = c;
  if (d.bitfield.reg16 != 1)
abort();
  if (d.bitfield.imm16 != 0)
abort();
  if (d.array[1] != 22)
abort();

  return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-22 Thread d dot g dot gorbachev at gmail dot com


--- Comment #8 from d dot g dot gorbachev at gmail dot com  2009-06-22 
10:05 ---
This is probably the same bug: binutils 2.19.51.20090616 (build, host:
i686-pc-linux-gnu, target: i686-pc-mingw32), compiled with GCC 4.5.0 20090618.

GAS aborts when tries to assemble this instruction:

  imull   $-1431655765, %eax, %eax

Internal error, aborting at ../../binutils-2.19.51/gas/config/tc-i386.c line
4917 in build_modrm_byte


To avoid errors when compiling binutils, simply pass --disable-werror to
configure script.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-22 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-06-22 18:57 ---
Right, now I can reproduce the problem and it indeed is introduced by the new
SRA commit.  None of the fixes I have done so far deals with this one either. I
am investigating this further (but don't hold your breath, it is going to take
me a while).


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-06-22 18:57:00
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-20 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-06-20 13:21 ---
Created an attachment (id=18032)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18032action=view)
A patch to avoid warning from -Wall

You can apply this patch to binutils to avoid
warning from -Wall in gcc 4.5.0.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread hjl dot tools at gmail dot com


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

   Target Milestone|--- |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-06-19 18:09 ---
I will look into this next week.  However, I have never compiled binutils
before, so unless it is obvious, please describe how to reproduce the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread hjl dot tools at gmail dot com


--- Comment #2 from hjl dot tools at gmail dot com  2009-06-19 18:24 ---
(In reply to comment #1)
 I will look into this next week.  However, I have never compiled binutils
 before, so unless it is obvious, please describe how to reproduce the problem.
 

Just download the current Linux binutils:

http://www.kernel.org/pub/linux/devel/binutils/binutils-2.19.51.0.10.tar.bz2

on Linux/x86-64 and do

1. Untar
2. mkdir build
3. cd build
4. ../configure
5. make
6. make check

There should be no failures in testsuite.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread amodra at bigpond dot net dot au


--- Comment #3 from amodra at bigpond dot net dot au  2009-06-19 23:38 
---
With 148536 and current mainline cvs binutils I see no failures in the gas
testsuite.  I do see a bunch of failures in the ld testsuite, which are all
because /usr/bin/ld is being run despite a -B option being passed to gcc that
should cause the newly built ld to be used.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread hjl dot tools at gmail dot com


--- Comment #4 from hjl dot tools at gmail dot com  2009-06-20 01:11 ---
(In reply to comment #3)
 With 148536 and current mainline cvs binutils I see no failures in the gas
 testsuite.  I do see a bunch of failures in the ld testsuite, which are all
 because /usr/bin/ld is being run despite a -B option being passed to gcc that
 should cause the newly built ld to be used.
 

With revision 148536, I got

cc1: warnings being treated as errors
/export/gnu/import/svn/binutils/src/bfd/elflink.c: In function
‘elf_link_add_object_symbols’:
/export/gnu/import/svn/binutils/src/bfd/elflink.c:3552:6: error: jump skips
variable initialization
/export/gnu/import/svn/binutils/src/bfd/elflink.c:3637:7: note: label
‘error_free_dyn’ defined here
/export/gnu/import/svn/binutils/src/bfd/elflink.c:3626:18: note: ‘tagv’
declared here

It won't even compile.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread amodra at bigpond dot net dot au


--- Comment #5 from amodra at bigpond dot net dot au  2009-06-20 03:26 
---
Oops, you're correct.  I wan't using the compiler I thought I was.  make CC=...
wasn't passing $CC down to the bfd dir for some reason.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread hjl dot tools at gmail dot com


--- Comment #6 from hjl dot tools at gmail dot com  2009-06-20 04:11 ---
Revision 148512 failed to build binutils. You may need to remove -Werror
from CFLAGS in Makefile by hand when building binutils.  See PR 40500.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

  BugsThisDependsOn||40500


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493