This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code
- From: "belyshev at depni dot sinp dot msu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2005 21:43:31 -0000
- Subject: [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This patch:
2003-11-02 Roger Sayle <roger@eyesopen.com>
PR optimization/10817
* ifcvt.c (noce_emit_move_insn): Improve documentation comment.
(noce_try_move): New function to optimize an if-the-else into an
unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a".
(noce_process_if_block): Attempt simplification with noce_try_move.
causes wrong codegen for this testcase, (taken from debian bug #325050, see
bugs.debian.org/cgi-bin/bugreport.cgi?bug=325050 )
-----------------------------
struct
{
int len;
char *name;
} s;
int main (void)
{
s.len = 0;
s.name = "";
if (s.name [s.len] != 0)
s.name [s.len] = 0;
return 0;
}
-----------------------------
This looks very similar to PR 13400.
--
Summary: [3.4/4.0 regression] if-conversion causes wrong code
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: belyshev at depni dot sinp dot msu dot ru
CC: gcc-bugs at gcc dot gnu dot org,sayle at gcc dot gnu dot
org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23567