[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-20 Thread jakub at gcc dot gnu dot org


--- Comment #10 from jakub at gcc dot gnu dot org  2009-10-20 09:39 ---
Created an attachment (id=18832)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18832action=view)
gcc45-pr41340.patch

Patch I'm going to bootstrap/regtest.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-20 Thread jakub at gcc dot gnu dot org


--- Comment #11 from jakub at gcc dot gnu dot org  2009-10-20 13:29 ---
Subject: Bug 41340

Author: jakub
Date: Tue Oct 20 13:29:08 2009
New Revision: 153011

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153011
Log:
PR debug/41340
* loop-invariant.c (calculate_loop_reg_pressure): Don't count regs
referenced just in DEBUG_INSNs.

* gcc.dg/pr41340.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr41340.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-invariant.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-20 Thread jakub at gcc dot gnu dot org


--- Comment #12 from jakub at gcc dot gnu dot org  2009-10-20 14:32 ---
The original rtl.ii.gz testcase compiles just fine with -fcompare-debug too
(though, it surely used to be something different, as those loop-invariant.c
changes are from end of September).


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-19 Thread jakub at gcc dot gnu dot org


--- Comment #7 from jakub at gcc dot gnu dot org  2009-10-19 17:05 ---
Confirmed, for -m32 -march=i686 -O3 -g vs. -g0 generates different code on:
typedef struct { int t; } *T;
struct S1 { unsigned s1; };
struct S2 { struct S1 s2; };
struct S3 { unsigned s3; struct S2 **s4; };
struct S5 { struct S2 *s5; };

extern void fn0 (void) __attribute__ ((__noreturn__));
T fn6 (struct S3);
void fn7 (void);

int
fn1 (const struct S1 *x)
{
  return x-s1;
}

int
fn2 (const struct S1 *x, unsigned y)
{
  if (y = x-s1)
fn0 ();
  return 0;
}

int
fn3 (struct S3 x)
{
  return (x.s3 == fn1 (*x.s4 ? (*x.s4)-s2 : 0));
}

int
fn4 (struct S3 x)
{
  return fn2 ((*x.s4)-s2, x.s3);
}

int
fn5 (struct S3 x, T *y)
{
  if (!fn3 (x))
{
  *y = (T) (long) fn4 (x);
  return 1;
}
  return 0;
}

void
test (struct S5 *x)
{
  struct S3 a;
  T b;
  unsigned char c = 0;
  a.s4 = x-s5;
  while (fn5 (a, b))
if (!(b-t  8))
  c = 1;
  a.s4 = x-s5;
  while ((b = fn6 (a)))
;
  if (!c)
fn7 ();
}


-- 


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-19 Thread jakub at gcc dot gnu dot org


--- Comment #8 from jakub at gcc dot gnu dot org  2009-10-19 17:14 ---
NONDEBUG_INSN_P differences start appearing in DSE1, looking into it.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-10-19 17:14:34
   date||


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-19 Thread jakub at gcc dot gnu dot org


--- Comment #9 from jakub at gcc dot gnu dot org  2009-10-19 18:35 ---
Actually, it is not DSE1 but already loop-invariant.c, and the difference is in
max_reg_pressure of the current loop (4 vs. 5 for one of the classes).


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||vmakarov at gcc dot gnu dot
   ||org
 AssignedTo|jakub at gcc dot gnu dot org|unassigned at gcc dot gnu
   ||dot org
 Status|ASSIGNED|NEW


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-16 Thread d dot g dot gorbachev at gmail dot com


--- Comment #5 from d dot g dot gorbachev at gmail dot com  2009-10-16 
20:09 ---
There is a real difference, i.e.

- 179:  mov0x8(%ebp),%edx
- 17c:  movzwl (%edx),%eax
+ 179:  mov0x8(%ebp),%esi
+ 17c:  movzwl (%esi),%eax

[...]

- 1a0:  mov%edx,(%esp)
- 1a3:  mov%edx,-0x24(%ebp)
- 1a6:  call   1a7 _Z8copy_rtxP7rtx_def+0x37
- 1ab:  mov%eax,%ecx
- 1ad:  movzbl 0x3(%eax),%eax
- 1b1:  mov%eax,%esi
- 1b3:  and$0xffdf,%eax

[...]

+ 1a0:  mov%esi,(%esp)
+ 1a3:  call   1a4 _Z8copy_rtxP7rtx_def+0x34
+ 1a8:  mov%eax,%edi
+ 1aa:  movzbl 0x3(%eax),%eax
+ 1ae:  mov%eax,%ecx
+ 1b0:  and$0xffdf,%eax
+ 1b3:  mov%al,0x3(%edi)

etc.

-fcompare-debug produces  -fcompare-debug failure (length)


-- 

d dot g dot gorbachev at gmail dot com changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-16 Thread d dot g dot gorbachev at gmail dot com


--- Comment #6 from d dot g dot gorbachev at gmail dot com  2009-10-16 
20:12 ---
Created an attachment (id=18813)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18813action=view)
gzipped preprocessed source file

Another case. Compile with:

cc1 -O3 -march=i686 -g tree-eh.i


-2fb6:  sub$0xdc,%esp
+2fb6:  sub$0xcc,%esp

[...]

-38f2:  mov$0x1,%edi
-38f7:  movb   $0x0,-0x98(%ebp)
-38fe:  mov%edx,-0x9c(%ebp)
-3904:  cmp%eax,(%ecx)
-3906:  jne3ad9 execute_cleanup_eh+0xb29

[...]

+38f2:  xor%edi,%edi
+38f4:  cmp%eax,(%ecx)
+38f6:  jne3ac3 execute_cleanup_eh+0xb13
+38fc:  mov0x0,%eax
+3901:  xor%esi,%esi


-- 


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-10-15 Thread aoliva at gcc dot gnu dot org


--- Comment #4 from aoliva at gcc dot gnu dot org  2009-10-15 18:17 ---
Is this just because of the use of random number generators to name symbols
with internal linkage, or is there some actual difference that -fcompare-debug
detects?  (-fcompare-debug uses -frandom-seed to avoid the differences).


-- 

aoliva at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-09-19 Thread davek at gcc dot gnu dot org


--- Comment #2 from davek at gcc dot gnu dot org  2009-09-19 09:20 ---
Unsurprisingly, adding -g0 to the build line results in an expr.o without the
undefined reference.

/gnu/gcc/obj.no.pr41357/./prev-gcc/xgcc -B/gnu/gcc/obj.no.pr41357/./prev-gcc/
-B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/bin/
-B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem
/opt/gcc-tools/i686-pc-cygwin/include -isystem
/opt/gcc-tools/i686-pc-cygwin/sys-include-c  -g -O2 -DIN_GCC   -W -Wall
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common
 -DHAVE_CONFIG_H -I ../gcc -Ijava -I/gnu/gcc/gcc-unpatched/gcc
-I/gnu/gcc/gcc-unpatched/gcc/java -I/gnu/gcc/gcc-unpatched/gcc/../include
-I/gnu/gcc/gcc-unpatched/gcc/../libcpp/include -I/usr/include -I/usr/include
-I/gnu/gcc/gcc-unpatched/gcc/../libdecnumber
-I/gnu/gcc/gcc-unpatched/gcc/../libdecnumber/dpd -I../libdecnumber   
/gnu/gcc/gcc-unpatched/gcc/java/expr.c -o java/expr.o --save-temps -g0


-- 


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-09-19 Thread davek at gcc dot gnu dot org


--- Comment #3 from davek at gcc dot gnu dot org  2009-09-19 09:21 ---
(In reply to comment #2)
 Unsurprisingly, 

Oops, sorry, wrong PR!  I was on the wrong browser tab.  Apologies.


-- 


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



[Bug debug/41340] [4.5 Regression] G++ produces different code with and without -g option

2009-09-18 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|other   |debug
   Keywords||build
   Priority|P3  |P2


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