This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/9279: [3.2 regression] [Sparc] combine bug
- From: "Christian Ehrhardt" <ehrhardt at mathematik dot uni-ulm dot de>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, frank at g-n-u dot de, nobody at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, doko at debian dot org
- Date: Fri, 24 Jan 2003 11:57:26 +0100
- Subject: Re: optimization/9279: [3.2 regression] [Sparc] combine bug
Hi,
here's an even simpler example:
int x = 0;
char c, * p = &c, a = -1;
int main ()
{
if ((x?0:(unsigned char)((*p) = a)) == -1)
return 0;
return 1;
}
The exitcode of this program should always be 1 but it is zero if
compiled with -O2.
The problem is that these two insns
(insn 24 23 25 (set (reg:SI 117)
(zero_extend:SI (reg:QI 116))) 126 {*zero_extendqisi2_insn} (nil)
(expr_list:REG_DEAD (reg:QI 116)
(nil)))
(insn 25 24 26 (set (reg:CC 100 %icc)
(compare:CC (reg:SI 117)
(const_int -1 [0xffffffffffffffff]))) 0 {*cmpsi_insn} (insn_list 24 (nil))
(expr_list:REG_DEAD (reg:SI 117)
(nil)))
are combined into one like this:
(note 24 23 25 NOTE_INSN_DELETED)
(insn 25 24 26 (set (reg:CC 100 %icc)
(compare:CC (subreg:SI (reg:QI 116) 0)
(const_int 255 [0xff]))) 0 {*cmpsi_insn} (nil)
(expr_list:REG_DEAD (reg:QI 116)
(nil)))
regards Christian