public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14029] New: [tree-ssa] wrong-code
@ 2004-02-05 12:54 stefaandr at hotmail dot com
  2004-02-05 16:30 ` [Bug optimization/14029] " bangerth at dealii dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: stefaandr at hotmail dot com @ 2004-02-05 12:54 UTC (permalink / raw)
  To: gcc-bugs

Following code (sorry, still contains STL, but I did a lot of trimming 
already) gives a wrong result when optimization is enabled: 
 
#include <vector> 
#include <algorithm> 
 
struct a { 
  int n; 
  bool operator==(a const & other) const { return n == other.n; }; 
}; 
 
int main() { 
  a a1; std::vector <a> as; 
  a1.n = 4; for (int i=0; i<4; ++i) as.push_back(a1); 
  a1.n = 7; as.push_back(a1); 
  return std::find(as.begin(), as.end(), a1) == as.end(); 
}; 
 
Reading specs 
from /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/specs 
Configured with: /esat/firenze/tmp/src/gcc/ssa/configure --program-suffix=-ssa 
--prefix=/esat/olympia/install --enable-languages=c,c++ 
Thread model: posix 
gcc version 3.5-tree-ssa 20040204 (merged 20040126) 
 /esat/olympia/install/libexec/gcc/i686-pc-linux-gnu/3.5-tree-ssa/cc1plus 
-quiet -v -D_GNU_SOURCE tst.cpp -quiet -dumpbase tst.cpp -mtune=pentiumpro 
-auxbase tst -O9 -version -o /tmp/ccQc86SB.s 
ignoring nonexistent directory 
"/esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../i686-pc-linux-gnu/include" 
#include "..." search starts here: 
#include <...> search starts here: 
 /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa 
 /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa/i686-pc-linux-gnu 
 /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa/backward 
 /usr/local/include 
 /esat/olympia/install/include 
 /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/include 
 /usr/include 
End of search list. 
GNU C++ version 3.5-tree-ssa 20040204 (merged 20040126) (i686-pc-linux-gnu) 
        compiled by GNU C version 3.3.1. 
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 
 as -V -Qy -o /tmp/cco9g0GA.o /tmp/ccQc86SB.s 
GNU assembler version 2.14 (i686-pc-linux-gnu) using BFD version 2.14 20030612 
 /esat/olympia/install/libexec/gcc/i686-pc-linux-gnu/3.5-tree-ssa/collect2 
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o 
tst /usr/lib/crt1.o /usr/lib/crti.o /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/crtbegin.o 
-L/esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa 
-L/esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../.. /tmp/cco9g0GA.o 
-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s 
-lgcc /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/crtend.o /usr/lib/crtn.o

-- 
           Summary: [tree-ssa] wrong-code
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stefaandr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug optimization/14029] [tree-ssa] wrong-code
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
@ 2004-02-05 16:30 ` bangerth at dealii dot org
  2004-02-05 16:41 ` bangerth at dealii dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-02-05 16:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-05 16:30 -------
Interesting. I confirm the bug, but it only happens if the loop 
in main() is executed at least 4 times... 
 
W. 

-- 


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


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

* [Bug optimization/14029] [tree-ssa] wrong-code
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
  2004-02-05 16:30 ` [Bug optimization/14029] " bangerth at dealii dot org
@ 2004-02-05 16:41 ` bangerth at dealii dot org
  2004-02-05 18:37 ` [Bug optimization/14029] [tree-ssa] Miscompilation of unrolled loop bangerth at dealii dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-02-05 16:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-05 16:41 -------
I'm working on a reduced testcase. 
W. 

-- 


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


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

* [Bug optimization/14029] [tree-ssa] Miscompilation of unrolled loop
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
  2004-02-05 16:30 ` [Bug optimization/14029] " bangerth at dealii dot org
  2004-02-05 16:41 ` bangerth at dealii dot org
@ 2004-02-05 18:37 ` bangerth at dealii dot org
  2004-02-06  3:11 ` [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-02-05 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-05 18:36 -------
OK, here's something smaller: 
----------------------------- 
struct Iterator { 
    int * ptr; 
 
    Iterator(int * i) : ptr(i) { } 
    void operator++() { ++ptr; } 
    int *const & base() const { return ptr; } 
}; 
 
 
Iterator find_7(Iterator first, Iterator last) 
{ 
  int trip_count  = (last.base() - first.base()) >> 1; 
 
  for ( ; trip_count > 0 ; --trip_count) { 
    if (*first.ptr == 7) return first; 
    ++first; 
 
    if (*first.ptr == 7) return first; 
    ++first; 
  } 
 
  switch(last.base() - first.base()) { 
    case 1: 
          if (*first.ptr == 7) return first; 
          ++first; 
    case 0: 
    default: 
          return last; 
  } 
} 
 
int main() { 
  int as[5] = {4,4,4,4,7};   
  return (find_7(Iterator(&as[0]), Iterator(&as[5])).ptr == &as[5]); 
}; 
------------------------ 
 
The function find_7 is miscompiled: 
g/x> /home/bangerth/bin/gcc-tree-ssa/bin/c++ x.cc && ./a.out ; echo $? 
0 
g/x> /home/bangerth/bin/gcc-tree-ssa/bin/c++ x.cc -O2 && ./a.out ; echo $? 
1 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
      Known to work|                            |3.4.0 3.5.0 3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-05 18:37:03
               date|                            |
            Summary|[tree-ssa] wrong-code       |[tree-ssa] Miscompilation of
                   |                            |unrolled loop
   Target Milestone|---                         |tree-ssa


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


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

* [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (2 preceding siblings ...)
  2004-02-05 18:37 ` [Bug optimization/14029] [tree-ssa] Miscompilation of unrolled loop bangerth at dealii dot org
@ 2004-02-06  3:11 ` pinskia at gcc dot gnu dot org
  2004-02-09  2:21 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06  3:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 03:10 -------
This is caused by -fstrict-aliasing.

The problem is that C++ (and the C by the way if converted to act like C) front-end is doing this 
for Iterator::base :

int* const& Iterator::base() const (this)
{
  {
    return (int * const *)this;
  }
}

which is wrong as it violates aliasing rules.


For a C example:

int **t(struct Iterator*this1)
{
  return &this1->ptr;
}

Does this:
t (this1)
{
  return (int * *)this1;
}


Even it gets this wrong too:
struct Iterator {
    int * ptr;
    int * ptr1;
};
int **t(struct Iterator*this1)
{
  return &this1->ptr1;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
          Component|optimization                |c++
   Last reconfirmed|2004-02-05 18:37:03         |2004-02-06 03:10:57
               date|                            |
            Summary|[tree-ssa] Miscompilation of|[tree-ssa] Miscompilation of
                   |unrolled loop               |unrolled loop due to
                   |                            |Iterator::base having an
                   |                            |aliasing problem


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


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

* [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (3 preceding siblings ...)
  2004-02-06  3:11 ` [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem pinskia at gcc dot gnu dot org
@ 2004-02-09  2:21 ` pinskia at gcc dot gnu dot org
  2004-03-01 16:57 ` amacleod at redhat dot com
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-09  2:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-09 02:21 -------
Basically the problem is in both the C and C++ front-ends lowering too soon so that offset  
will work correctly.  So the change to fix this needs to have a builtin for offset like the on in 
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00032.html, I am going to update that 
patch and try to fix it for the C++ template problems.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (4 preceding siblings ...)
  2004-02-09  2:21 ` pinskia at gcc dot gnu dot org
@ 2004-03-01 16:57 ` amacleod at redhat dot com
  2004-05-15  3:38 ` [Bug tree-optimization/14029] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: amacleod at redhat dot com @ 2004-03-01 16:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amacleod at redhat dot com  2004-03-01 16:57 -------
(From update of attachment 5829)
Sigh.. here it happened again.. My patch is for a differnt PR 14016... ignore
this .

Apparently when I submit something, my browser is bumping the bug to the next
one in some list, and Im not noticing. I was expecting it to stay in the same
bug...


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #5829 is|0                           |1
           obsolete|                            |


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (5 preceding siblings ...)
  2004-03-01 16:57 ` amacleod at redhat dot com
@ 2004-05-15  3:38 ` pinskia at gcc dot gnu dot org
  2004-07-10  1:25 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-15  3:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-14 17:24 -------
*** Bug 15440 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin at mpa-garching dot
                   |                            |mpg dot de


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (6 preceding siblings ...)
  2004-05-15  3:38 ` [Bug tree-optimization/14029] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-07-10  1:25 ` pinskia at gcc dot gnu dot org
  2004-07-26 22:46 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-10  1:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-10 01:25 -------
*** Bug 16282 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at tat dot physik
                   |                            |dot uni-tuebingen dot de


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (7 preceding siblings ...)
  2004-07-10  1:25 ` pinskia at gcc dot gnu dot org
@ 2004-07-26 22:46 ` pinskia at gcc dot gnu dot org
  2004-08-23  3:12 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-26 22:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-26 22:46 -------
*** Bug 16728 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at gcc dot gnu dot org


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (8 preceding siblings ...)
  2004-07-26 22:46 ` pinskia at gcc dot gnu dot org
@ 2004-08-23  3:12 ` cvs-commit at gcc dot gnu dot org
  2004-08-23  3:13 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-23  3:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-23 03:12 -------
Subject: Bug 14029

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-08-23 03:12:39

Modified files:
	gcc            : ChangeLog c-typeck.c 
	gcc/testsuite  : ChangeLog 
	gcc/cp         : typeck.c ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: pr14029.C 
	gcc/testsuite/gcc.c-torture/execute: pr15262.c 

Log message:
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	PR c/15262
	* c-typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.
	(c_finish_return): Do not go through INDIRECT_REF when looking
	for the inner expression of an ADDR_EXPR for warning about.
	
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	* g++.dg/opt/pr14029.C: New test.
	* gcc.c-torture/execute/pr15262.c: New test.
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	PR c++/14029
	* typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5024&r2=2.5025
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.359&r2=1.360
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4172&r2=1.4173
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.567&r2=1.568
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4293&r2=1.4294
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr14029.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr15262.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (9 preceding siblings ...)
  2004-08-23  3:12 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-23  3:13 ` pinskia at gcc dot gnu dot org
  2004-08-23  4:02 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-23  3:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-23 03:13 -------
Fixed by a change in the front-end.

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


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (10 preceding siblings ...)
  2004-08-23  3:13 ` pinskia at gcc dot gnu dot org
@ 2004-08-23  4:02 ` cvs-commit at gcc dot gnu dot org
  2004-08-23 18:25 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-23  4:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-23 04:02 -------
Subject: Bug 14029

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-ppc-branch
Changes by:	pinskia@gcc.gnu.org	2004-08-23 04:02:01

Modified files:
	gcc            : ChangeLog.apple-ppc c-typeck.c 
	gcc/cp         : ChangeLog.apple-ppc typeck.c 
	gcc/testsuite  : ChangeLog.apple-ppc 
Added files:
	gcc/testsuite/g++.dg/opt: pr14029.C 
	gcc/testsuite/gcc.c-torture/execute: pr15262.c 

Log message:
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	PR c/15262
	* c-typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.
	(c_finish_return): Do not go through INDIRECT_REF when looking
	for the inner expression of an ADDR_EXPR for warning about.
	
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	* g++.dg/opt/pr14029.C: New test.
	* gcc.c-torture/execute/pr15262.c: New test.
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	
	PR c++/14029
	* typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.129&r2=1.1.2.130
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.196.2.43.2.13&r2=1.196.2.43.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.7&r2=1.1.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.408.2.43.2.12&r2=1.408.2.43.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.25&r2=1.1.2.26
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr14029.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr15262.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (11 preceding siblings ...)
  2004-08-23  4:02 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-23 18:25 ` cvs-commit at gcc dot gnu dot org
  2004-08-23 18:28 ` cvs-commit at gcc dot gnu dot org
  2004-09-14 22:58 ` [Bug tree-optimization/14029] [4.0 " dnovillo at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-23 18:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-23 18:24 -------
Subject: Bug 14029

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-08-23 18:24:23

Modified files:
	gcc/cp         : ChangeLog typeck.c 

Log message:
	2004-08-22 Andrew Pinski  <apinski@apple.com>
	
	Revert:
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	PR c++/14029
	* typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4295&r2=1.4296
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.568&r2=1.569



-- 


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


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

* [Bug tree-optimization/14029] [3.5 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (12 preceding siblings ...)
  2004-08-23 18:25 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-23 18:28 ` cvs-commit at gcc dot gnu dot org
  2004-09-14 22:58 ` [Bug tree-optimization/14029] [4.0 " dnovillo at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-23 18:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-23 18:28 -------
Subject: Bug 14029

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-ppc-branch
Changes by:	pinskia@gcc.gnu.org	2004-08-23 18:28:12

Modified files:
	gcc/cp         : ChangeLog.apple-ppc typeck.c 

Log message:
	2004-08-22 Andrew Pinski  <apinski@apple.com>
	
	Revert:
	2004-08-22  Andrew Pinski  <apinski@apple.com>
	PR c++/14029
	* typeck.c (build_unary_op): Use &a.b if the foldded lowered
	expression is not constant.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.8&r2=1.1.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.408.2.43.2.13&r2=1.408.2.43.2.14



-- 


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


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

* [Bug tree-optimization/14029] [4.0 Regression] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem
  2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
                   ` (13 preceding siblings ...)
  2004-08-23 18:28 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-14 22:58 ` dnovillo at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-09-14 22:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 14029 depends on bug 15262, which changed state.

Bug 15262 Summary: [4.0 Regression] [tree-ssa] Alias analyzer cannot handle addressable fields
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15262

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

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


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

end of thread, other threads:[~2004-09-14 22:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05 12:54 [Bug optimization/14029] New: [tree-ssa] wrong-code stefaandr at hotmail dot com
2004-02-05 16:30 ` [Bug optimization/14029] " bangerth at dealii dot org
2004-02-05 16:41 ` bangerth at dealii dot org
2004-02-05 18:37 ` [Bug optimization/14029] [tree-ssa] Miscompilation of unrolled loop bangerth at dealii dot org
2004-02-06  3:11 ` [Bug c++/14029] [tree-ssa] Miscompilation of unrolled loop due to Iterator::base having an aliasing problem pinskia at gcc dot gnu dot org
2004-02-09  2:21 ` pinskia at gcc dot gnu dot org
2004-03-01 16:57 ` amacleod at redhat dot com
2004-05-15  3:38 ` [Bug tree-optimization/14029] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-07-10  1:25 ` pinskia at gcc dot gnu dot org
2004-07-26 22:46 ` pinskia at gcc dot gnu dot org
2004-08-23  3:12 ` cvs-commit at gcc dot gnu dot org
2004-08-23  3:13 ` pinskia at gcc dot gnu dot org
2004-08-23  4:02 ` cvs-commit at gcc dot gnu dot org
2004-08-23 18:25 ` cvs-commit at gcc dot gnu dot org
2004-08-23 18:28 ` cvs-commit at gcc dot gnu dot org
2004-09-14 22:58 ` [Bug tree-optimization/14029] [4.0 " dnovillo at gcc dot gnu dot org

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).