public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43629]  New: Struct to register optimization fails
@ 2010-04-02  9:46 julien dot etienne at gmail dot com
  2010-04-02 11:32 ` [Bug tree-optimization/43629] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: julien dot etienne at gmail dot com @ 2010-04-02  9:46 UTC (permalink / raw)
  To: gcc-bugs

Hello,

It seems that when a structure is 64bit large the optimizer uses a register to
store it, but does not managed the initialization of the fields properly,
leading to a wrong result at the end.

Here is my test case:
cat main.c
struct A {
   short A1 ;
   short A2 ;
   int   A3 ;
};

extern void* bar(void);

static struct A foo(void) __attribute__ ((noinline));

static struct A foo(void)
{
   struct A result;
   void *pB;

   result.A1 = (short)0;
   result.A2 = (short)0;
   /* The next field is intentionally not initialized */
   /* result.A3 = 0; */

   pB = bar(); /* always return (void*)1 to highlight the bug */
   if (pB == ((void *)0)) {
                  /* Should never been triggered at run time */
      result.A1 = (short)1;
      result.A2 = (short)2;
      result.A3 = 3;
      return result;
   }

         /* result.A1 should be (short)0 */
   return result;

}

int main(){
        struct A myA = foo();
        return (int)myA.A1; /* should always return 0 by design */
}

cat bar.c
void* bar(void){
        return (void*)1;
}

Compilation with -O0 works and the return status is 0 as expected:
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc -O0 -Wall   -c -o main.o
main.c
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc -O0 -Wall   -c -o bar.o
bar.c
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc   main.o bar.o   -o main
./main
echo $?
0

Compilation with -O1 works but the return status is 1 due to the bug:
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc -O1 -Wall   -c -o main.o
main.c
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc -O1 -Wall   -c -o bar.o
bar.c
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc   main.o bar.o   -o main
./main
echo $?
1

As the code is deterministic the result should have been 0 in both cases.

The disassembly of main.o file makes it pretty clear that the generated
optimized code is wrong:
objdump -d main.o

main.o:     file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <foo>:
   0:   48 83 ec 08             sub    $0x8,%rsp
   4:   e8 00 00 00 00          callq  9 <foo+0x9>
   9:   48 b8 01 00 02 00 03    mov    $0x300020001,%rax  <<< Value always
returned
  10:   00 00 00
  13:   48 83 c4 08             add    $0x8,%rsp
  17:   c3                      retq

0000000000000018 <main>:
  18:   48 83 ec 08             sub    $0x8,%rsp
  1c:   e8 df ff ff ff          callq  0 <foo>
  21:   98                      cwtl
  22:   48 83 c4 08             add    $0x8,%rsp
  26:   c3                      retq

As you can see in all cases the returned value of function foo is set by "mov  
 $0x300020001,%rax" whereas there should also be 2 cases.

My gcc version:
/projects/dsr/work/jetienne/softs/gcc-4.4.3/bin/gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure
--prefix=/projects/dsr/work/jetienne/softs/gcc-4.4.3 --enable-languages=c,c++
--with-mpfr=/tools/mpfr-2.4.2
Thread model: posix
gcc version 4.4.3 (GCC)

FYI I tried several gcc versions, here are the status:
- gcc 3.4.5 works
- gcc 4.1.2 works
- gcc 4.3.2 does not work
- gcc 4.4.3 does not work

I am testing the svn trunk at the moment I will get back to you with my result.

Best Regards,
Julien


-- 
           Summary: Struct to register optimization fails
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: julien dot etienne at gmail dot com
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
@ 2010-04-02 11:32 ` rguenth at gcc dot gnu dot org
  2010-04-02 11:47 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-02 11:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-04-02 11:31 -------
Confirmed.  Yet another SRA to bitfield magic issue.

Workaround: -fno-tree-sra.

struct A {
   short A1 ;
   short A2 ;
   int   A3 ;
};

static struct A __attribute__((noinline))
foo(int b)
{
   struct A result;
   result.A1 = (short)0;
   result.A2 = (short)0;
   /* result.A3 is intentionally not initialized */
   if (b) {
      result.A1 = (short)1;
      result.A2 = (short)2;
      result.A3 = 3;
      return result;
   }
   return result;
}

extern void abort (void);

int main()
{
  struct A myA = foo(0);
  if (myA.A1 != 0)
    abort ();
  return 0;
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
      Known to fail|                            |4.3.0 4.3.4 4.4.0 4.4.3
      Known to work|                            |4.2.4 4.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-02 11:31:52
               date|                            |
            Summary|Struct to register          |[4.3/4.4 Regression] Struct
                   |optimization fails          |to register optimization
                   |                            |fails
   Target Milestone|---                         |4.3.5


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
  2010-04-02 11:32 ` [Bug tree-optimization/43629] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2010-04-02 11:47 ` rguenth at gcc dot gnu dot org
  2010-04-02 12:51 ` [Bug tree-optimization/43629] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-02 11:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-04-02 11:47 -------
SRA introduces a use of the uninitialized value when re-constructing the
unsigned long representation.  That boils down to later CCP recognizing
the result as undefined and thus:

Visiting statement:
SR.16_25 = (unsigned int) result$A3_24(D);
which is likely UNDEFINED

Visiting statement:
SR.17_26 = (long unsigned int) SR.16_25;
which is likely UNDEFINED

Visiting statement:
SR.18_27 = SR.17_26 << 32;
which is likely UNDEFINED

Visiting statement:
SR.3_34 = SR.18_27 & 0x0ffffffff00000000;
which is likely UNDEFINED

Visiting PHI node: SR.3_2 = PHI <12885032961(2), SR.3_34(3)>

    Argument #0 (2 -> 4 executable)
        12885032961     Value: CONSTANT 12885032961

    Argument #1 (3 -> 4 executable)
        SR.3_34 Value: UNDEFINED

    PHI node value: CONSTANT 12885032961

Lattice value changed to CONSTANT 12885032961.


and we completely ignore the taken path.

One issue is that

Visiting statement:
SR.3_34 = SR.18_27 & 0x0ffffffff00000000;
which is likely UNDEFINED

is not 100% true - the value is only partially undefined (only the defined
pieces will be used later).  But of course that's splitting hairs somewhat
(but it might be the easiest fix for this bug).

tree-ssa-ccp.c:likely_value needs to look at regular rhs operands for
literal constants (see trunk version) but also make sure to re-set
all_undefined_operands if it encounters such.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-04-02 11:31:52         |2010-04-02 11:47:23
               date|                            |


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4/4.5 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
  2010-04-02 11:32 ` [Bug tree-optimization/43629] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
  2010-04-02 11:47 ` rguenth at gcc dot gnu dot org
@ 2010-04-02 12:51 ` rguenth at gcc dot gnu dot org
  2010-04-02 15:03 ` julien dot etienne at gmail dot com
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-02 12:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-04-02 12:50 -------
Really a CCP bug.

int flag;
extern void abort (void);
int main()
{
  int x;
  if (flag)
    x = -1;
  else
    x &= 0xff;
  if (x & ~0xff)
    abort ();
  return 0;
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3/4.4 Regression] Struct |[4.3/4.4/4.5 Regression]
                   |to register optimization    |Struct to register
                   |fails                       |optimization fails


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4/4.5 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (2 preceding siblings ...)
  2010-04-02 12:51 ` [Bug tree-optimization/43629] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
@ 2010-04-02 15:03 ` julien dot etienne at gmail dot com
  2010-04-02 15:05 ` rguenther at suse dot de
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: julien dot etienne at gmail dot com @ 2010-04-02 15:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from julien dot etienne at gmail dot com  2010-04-02 15:03 -------
What about using -O1 -fno-tree-ccp as a workaround rather than -O1
-fno-tree-rsa ?
Isn't it more efficient and more related to the root cause ?

Thanks for your help.

FYI: I was unable to check out the trunk due to firewall restriction (even on
http). I will try it from another connection.


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4/4.5 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (3 preceding siblings ...)
  2010-04-02 15:03 ` julien dot etienne at gmail dot com
@ 2010-04-02 15:05 ` rguenther at suse dot de
  2010-04-02 16:50 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenther at suse dot de @ 2010-04-02 15:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenther at suse dot de  2010-04-02 15:04 -------
Subject: Re:  [4.3/4.4/4.5 Regression] Struct
 to register optimization fails

On Fri, 2 Apr 2010, julien dot etienne at gmail dot com wrote:

> ------- Comment #4 from julien dot etienne at gmail dot com  2010-04-02 15:03 -------
> What about using -O1 -fno-tree-ccp as a workaround rather than -O1
> -fno-tree-rsa ?
> Isn't it more efficient and more related to the root cause ?
> 
> Thanks for your help.
> 
> FYI: I was unable to check out the trunk due to firewall restriction (even on
> http). I will try it from another connection.

Disabling constant propagation is going to affect code quality a lot
more (and might uncover latent bugs).  Anyway, I have a patch for
trunk already.


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4/4.5 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (4 preceding siblings ...)
  2010-04-02 15:05 ` rguenther at suse dot de
@ 2010-04-02 16:50 ` rguenth at gcc dot gnu dot org
  2010-04-02 16:51 ` [Bug tree-optimization/43629] [4.3/4.4 " rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-02 16:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2010-04-02 16:50 -------
Subject: Bug 43629

Author: rguenth
Date: Fri Apr  2 16:50:04 2010
New Revision: 157944

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157944
Log:
2010-04-02  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43629
        * tree-ssa-ccp.c (likely_value): Reset all_undefined_operands
        if we have seen a constant value.

        * gcc.c-torture/execute/pr43629.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr43629.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-ccp.c


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (5 preceding siblings ...)
  2010-04-02 16:50 ` rguenth at gcc dot gnu dot org
@ 2010-04-02 16:51 ` rguenth at gcc dot gnu dot org
  2010-04-02 20:12 ` julien dot etienne at gmail dot com
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-02 16:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2010-04-02 16:50 -------
Fixed for 4.5 sofar.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.3.0 4.3.4 4.4.0 4.4.3     |4.3.0 4.3.4 4.4.0 4.4.3
                   |4.5.0                       |
      Known to work|4.2.4                       |4.2.4 4.5.0
            Summary|[4.3/4.4/4.5 Regression]    |[4.3/4.4 Regression] Struct
                   |Struct to register          |to register optimization
                   |optimization fails          |fails


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (6 preceding siblings ...)
  2010-04-02 16:51 ` [Bug tree-optimization/43629] [4.3/4.4 " rguenth at gcc dot gnu dot org
@ 2010-04-02 20:12 ` julien dot etienne at gmail dot com
  2010-04-03 19:38 ` mikpe at it dot uu dot se
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: julien dot etienne at gmail dot com @ 2010-04-02 20:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from julien dot etienne at gmail dot com  2010-04-02 20:12 -------
Thanks for your help.
I will try the 4.5.0 version as soon as I can access svn.


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (7 preceding siblings ...)
  2010-04-02 20:12 ` julien dot etienne at gmail dot com
@ 2010-04-03 19:38 ` mikpe at it dot uu dot se
  2010-04-03 19:53 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: mikpe at it dot uu dot se @ 2010-04-03 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mikpe at it dot uu dot se  2010-04-03 19:38 -------
For 4.4 the test cases (both the original struct-using one and the later
integer-only one) are fixed by backporting r145184 (PR38180 fix) and then
r157944.  Either of them alone fixes neither test case.  Bootstrapped and
regression tested on x86_64-linux so far.


-- 

mikpe at it dot uu dot se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu dot se


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (8 preceding siblings ...)
  2010-04-03 19:38 ` mikpe at it dot uu dot se
@ 2010-04-03 19:53 ` rguenth at gcc dot gnu dot org
  2010-04-07 15:41 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-03 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2010-04-03 19:53 -------
(In reply to comment #9)
> For 4.4 the test cases (both the original struct-using one and the later
> integer-only one) are fixed by backporting r145184 (PR38180 fix) and then
> r157944.  Either of them alone fixes neither test case.  Bootstrapped and
> regression tested on x86_64-linux so far.

It only needs the likely_value changes backported (for 4.3 they need to
be adjusted to match the pre-tuples world).  I will do the backports once
4.5.0 is out of the door.


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (9 preceding siblings ...)
  2010-04-03 19:53 ` rguenth at gcc dot gnu dot org
@ 2010-04-07 15:41 ` rguenth at gcc dot gnu dot org
  2010-04-07 15:44 ` [Bug tree-optimization/43629] [4.3 " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-07 15:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from rguenth at gcc dot gnu dot org  2010-04-07 15:41 -------
Subject: Bug 43629

Author: rguenth
Date: Wed Apr  7 15:40:43 2010
New Revision: 158070

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158070
Log:
2010-04-07  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43629
        * tree-ssa-ccp.c (likely_value): Properly look for constant
        values.  Reset all_undefined_operands if we have seen a
        constant value.

        * gcc.c-torture/execute/pr43629.c: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr43629.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/tree-ssa-ccp.c


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (10 preceding siblings ...)
  2010-04-07 15:41 ` rguenth at gcc dot gnu dot org
@ 2010-04-07 15:44 ` rguenth at gcc dot gnu dot org
  2010-04-12  8:51 ` julien dot etienne at gmail dot com
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-07 15:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2010-04-07 15:44 -------
And backported for 4.4.4.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.2.4 4.5.0                 |4.2.4 4.4.4 4.5.0
            Summary|[4.3/4.4 Regression] Struct |[4.3 Regression] Struct to
                   |to register optimization    |register optimization fails
                   |fails                       |


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (11 preceding siblings ...)
  2010-04-07 15:44 ` [Bug tree-optimization/43629] [4.3 " rguenth at gcc dot gnu dot org
@ 2010-04-12  8:51 ` julien dot etienne at gmail dot com
  2010-04-12  9:01 ` rguenther at suse dot de
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: julien dot etienne at gmail dot com @ 2010-04-12  8:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from julien dot etienne at gmail dot com  2010-04-12 08:50 -------
Thanks for the fix !
Do you plan to backport it to 4.3.x ?

Best regards,
Julien Etienne


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (12 preceding siblings ...)
  2010-04-12  8:51 ` julien dot etienne at gmail dot com
@ 2010-04-12  9:01 ` rguenther at suse dot de
  2010-04-20 13:08 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenther at suse dot de @ 2010-04-12  9:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from rguenther at suse dot de  2010-04-12 09:00 -------
Subject: Re:  [4.3 Regression] Struct to register
 optimization fails

On Mon, 12 Apr 2010, julien dot etienne at gmail dot com wrote:

> ------- Comment #13 from julien dot etienne at gmail dot com  2010-04-12 08:50 -------
> Thanks for the fix !
> Do you plan to backport it to 4.3.x ?

Yes, once I find the time to do so - it's slightly non-trivial.

Richard.


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (13 preceding siblings ...)
  2010-04-12  9:01 ` rguenther at suse dot de
@ 2010-04-20 13:08 ` rguenth at gcc dot gnu dot org
  2010-04-20 13:09 ` rguenth at gcc dot gnu dot org
  2010-04-23 21:12 ` julien dot etienne at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-20 13:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2010-04-20 13:08 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (14 preceding siblings ...)
  2010-04-20 13:08 ` rguenth at gcc dot gnu dot org
@ 2010-04-20 13:09 ` rguenth at gcc dot gnu dot org
  2010-04-23 21:12 ` julien dot etienne at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-20 13:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2010-04-20 13:08 -------
Subject: Bug 43629

Author: rguenth
Date: Tue Apr 20 13:08:01 2010
New Revision: 158554

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158554
Log:
2010-04-20  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43629
        * tree-ssa-ccp.c (likely_value): Scan for literal constants
        as well.  Reset all_undefined_operands if we have seen a
        constant value.

        * gcc.c-torture/execute/pr43629.c: New testcase.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/execute/pr43629.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_3-branch/gcc/tree-ssa-ccp.c


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug tree-optimization/43629] [4.3 Regression] Struct to register optimization fails
  2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
                   ` (15 preceding siblings ...)
  2010-04-20 13:09 ` rguenth at gcc dot gnu dot org
@ 2010-04-23 21:12 ` julien dot etienne at gmail dot com
  16 siblings, 0 replies; 18+ messages in thread
From: julien dot etienne at gmail dot com @ 2010-04-23 21:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from julien dot etienne at gmail dot com  2010-04-23 21:12 -------
Thank you very much for the fix.
Everything now works as expected.

Best Regards,
Julien


-- 


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


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-04-23 21:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-02  9:46 [Bug c/43629] New: Struct to register optimization fails julien dot etienne at gmail dot com
2010-04-02 11:32 ` [Bug tree-optimization/43629] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2010-04-02 11:47 ` rguenth at gcc dot gnu dot org
2010-04-02 12:51 ` [Bug tree-optimization/43629] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
2010-04-02 15:03 ` julien dot etienne at gmail dot com
2010-04-02 15:05 ` rguenther at suse dot de
2010-04-02 16:50 ` rguenth at gcc dot gnu dot org
2010-04-02 16:51 ` [Bug tree-optimization/43629] [4.3/4.4 " rguenth at gcc dot gnu dot org
2010-04-02 20:12 ` julien dot etienne at gmail dot com
2010-04-03 19:38 ` mikpe at it dot uu dot se
2010-04-03 19:53 ` rguenth at gcc dot gnu dot org
2010-04-07 15:41 ` rguenth at gcc dot gnu dot org
2010-04-07 15:44 ` [Bug tree-optimization/43629] [4.3 " rguenth at gcc dot gnu dot org
2010-04-12  8:51 ` julien dot etienne at gmail dot com
2010-04-12  9:01 ` rguenther at suse dot de
2010-04-20 13:08 ` rguenth at gcc dot gnu dot org
2010-04-20 13:09 ` rguenth at gcc dot gnu dot org
2010-04-23 21:12 ` julien dot etienne at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).