aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-06-12 17:34:04 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-06-12 17:34:04 -0700
commit8433f113b64cc38f12215561ac79bddba6051b4c (patch)
tree6fc709a43bab07b0b7c9276aac590b950fb4ab81 /gcc/expmed.c
parent974c7cc67f1a4b606853c3abd0f87f60aec4339e (diff)
downloadgcc-8433f113b64cc38f12215561ac79bddba6051b4c.zip
gcc-8433f113b64cc38f12215561ac79bddba6051b4c.tar.gz
gcc-8433f113b64cc38f12215561ac79bddba6051b4c.tar.bz2
re PR middle-end/10475 (ICE in subreg_highpart_offset for code with long long)
PR middle-end/10475 * expmed.c (emit_store_flag): Use simplify_gen_subreg directly for extracting sub-words. * gcc.c-torture/compile/20030612-1.c: New. From-SVN: r67865
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5cc0894..4300756 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -4354,19 +4354,27 @@ emit_store_flag (target, code, op0, op1, mode, unsignedp, normalizep)
{
if (code == EQ || code == NE)
{
+ rtx op00, op01, op0both;
+
/* Do a logical OR of the two words and compare the result. */
- rtx op0h = gen_highpart (word_mode, op0);
- rtx op0l = gen_lowpart (word_mode, op0);
- rtx op0both = expand_binop (word_mode, ior_optab, op0h, op0l,
- NULL_RTX, unsignedp, OPTAB_DIRECT);
+ op00 = simplify_gen_subreg (word_mode, op0, mode, 0);
+ op01 = simplify_gen_subreg (word_mode, op0, mode, UNITS_PER_WORD);
+ op0both = expand_binop (word_mode, ior_optab, op00, op01,
+ NULL_RTX, unsignedp, OPTAB_DIRECT);
if (op0both != 0)
return emit_store_flag (target, code, op0both, op1, word_mode,
unsignedp, normalizep);
}
else if (code == LT || code == GE)
- /* If testing the sign bit, can just test on high word. */
- return emit_store_flag (target, code, gen_highpart (word_mode, op0),
- op1, word_mode, unsignedp, normalizep);
+ {
+ rtx op0h;
+
+ /* If testing the sign bit, can just test on high word. */
+ op0h = simplify_gen_subreg (word_mode, op0, mode,
+ subreg_highpart_offset (word_mode, mode));
+ return emit_store_flag (target, code, op0h, op1, word_mode,
+ unsignedp, normalizep);
+ }
}
/* From now on, we won't change CODE, so set ICODE now. */