Commit 407bcba7 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/49281 (lea_general_4 is wrong)

	PR target/49281
	* config/i386/i386.md (*lea_general_4): Require INTVAL (operands[3])
	to be strictly smaller than 1 << shiftcount.

	* gcc.c-torture/execute/pr49281.c: New test.

From-SVN: r174641
parent 0defd786
2011-06-04 Jakub Jelinek <jakub@redhat.com>
PR target/49281
* config/i386/i386.md (*lea_general_4): Require INTVAL (operands[3])
to be strictly smaller than 1 << shiftcount.
2011-06-04 Jan Hubicka <jh@suse.cz> 2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimize/48929 PR tree-optimize/48929
......
...@@ -6419,7 +6419,7 @@ ...@@ -6419,7 +6419,7 @@
|| optimize_function_for_size_p (cfun)) || optimize_function_for_size_p (cfun))
&& ((unsigned HOST_WIDE_INT) INTVAL (operands[2])) - 1 < 3 && ((unsigned HOST_WIDE_INT) INTVAL (operands[2])) - 1 < 3
&& ((unsigned HOST_WIDE_INT) INTVAL (operands[3]) && ((unsigned HOST_WIDE_INT) INTVAL (operands[3])
<= ((unsigned HOST_WIDE_INT) 1 << INTVAL (operands[2])))" < ((unsigned HOST_WIDE_INT) 1 << INTVAL (operands[2])))"
"#" "#"
"&& reload_completed" "&& reload_completed"
[(const_int 0)] [(const_int 0)]
......
2011-06-04 Jakub Jelinek <jakub@redhat.com>
PR target/49281
* gcc.c-torture/execute/pr49281.c: New test.
2011-06-04 Jan Hubicka <jh@suse.cz> 2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimize/48929 PR tree-optimize/48929
......
/* PR target/49281 */
extern void abort (void);
__attribute__((noinline, noclone)) int
foo (int x)
{
return (x << 2) | 4;
}
__attribute__((noinline, noclone)) int
bar (int x)
{
return (x << 2) | 3;
}
int
main ()
{
if (foo (43) != 172 || foo (1) != 4 || foo (2) != 12)
abort ();
if (bar (43) != 175 || bar (1) != 7 || bar (2) != 11)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment