public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/49497] New: Incorrect lea peephole
@ 2011-06-21 23:13 hjl.tools at gmail dot com
2011-06-21 23:20 ` [Bug target/49497] " hjl.tools at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-21 23:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49497
Summary: Incorrect lea peephole
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
CC: ubizjak@gmail.com
Target: x86
i386.md has
;; Convert imul by three, five and nine into lea
(define_peephole2
[(parallel
[(set (match_operand:SWI48 0 "register_operand" "")
(mult:SWI48 (match_operand:SWI48 1 "register_operand" "")
(match_operand:SWI48 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9"
[(set (match_dup 0)
(plus:SWI48 (mult:SWI48 (match_dup 1) (match_dup 2))
(match_dup 1)))]
"operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
(define_peephole2
[(parallel
[(set (match_operand:SWI48 0 "register_operand" "")
(mult:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "")
(match_operand:SWI48 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"optimize_insn_for_speed_p ()
&& (INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9)"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 0)
(plus:SWI48 (mult:SWI48 (match_dup 0) (match_dup 2))
(match_dup 0)))]
"operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
But lea split has
&& (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
When TARGET_PARTIAL_REG_STALL is true, get got
[hjl@gnu-33 1036]$ cat x.i
char *progName;
int *tt;
unsigned char *ll8;
extern void foo (const char *);
void cleanUpAndFail ( int ec ) {
__builtin_exit ( ec );
}
void uncompressOutOfMemory ( int draw, int blockSize ) {
foo ( "\tand failing that, find a machine with more memory.\n");
cleanUpAndFail(1);
}
void setDecompressStructureSizes ( int newSize100k ) {
int n = 100000 * newSize100k;
ll8 = __builtin_malloc ( n * sizeof(unsigned char) );
if (ll8 == ((void *)0) || tt == ((void *)0)) {
int totalDraw = n * sizeof(unsigned char) + n *
sizeof(unsigned int);
uncompressOutOfMemory ( totalDraw, n );
}
}
[hjl@gnu-33 1036]$ make x.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -S x.i
x.i: In function ‘setDecompressStructureSizes’:
x.i:19:2: error: unrecognizable insn:
(insn 43 19 21 4 (set (reg:SI 5 di [69])
(plus:SI (mult:SI (reg/v:SI 3 bx [orig:59 n ] [59])
(const_int 4 [0x4]))
(reg/v:SI 3 bx [orig:59 n ] [59]))) x.i:16 -1
(nil))
x.i:19:2: internal compiler error: in extract_insn, at recog.c:2113
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [x.s] Error 1
[hjl@gnu-33 1036]$
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-23 13:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21 23:13 [Bug target/49497] New: Incorrect lea peephole hjl.tools at gmail dot com
2011-06-21 23:20 ` [Bug target/49497] " hjl.tools at gmail dot com
2011-06-22 6:15 ` ubizjak at gmail dot com
2011-06-22 15:30 ` hjl at gcc dot gnu.org
2011-06-23 13:12 ` hjl.tools 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).