diff options
author | Richard Guenther <rguenther@suse.de> | 2010-11-03 09:57:13 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-11-03 09:57:13 +0000 |
commit | ca818bd905c80e424dbc4074bf6f25c6e5ccd897 (patch) | |
tree | 555a3fa17a2662f7d2864663132a609af6a412d7 /gcc/builtins.c | |
parent | 71056fef3b000a8b1e4793b3aa064c033588908f (diff) | |
download | gcc-ca818bd905c80e424dbc4074bf6f25c6e5ccd897.zip gcc-ca818bd905c80e424dbc4074bf6f25c6e5ccd897.tar.gz gcc-ca818bd905c80e424dbc4074bf6f25c6e5ccd897.tar.bz2 |
re PR middle-end/46251 (ICE: in expand_expr_real_2, at expr.c:7276 with -funsafe-math-optimizations -mbionic and __builtin_sincosl())
2010-11-03 Richard Guenther <rguenther@suse.de>
PR middle-end/46251
* builtins.c (expand_builtin_sincos): Properly build MEM_REFs,
not INDIRECT_REFs.
* gcc.dg/pr46251.c: New testcase.
From-SVN: r166235
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 4ff0546..31a869b 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -2474,6 +2474,7 @@ expand_builtin_sincos (tree exp) tree arg, sinp, cosp; int result; location_t loc = EXPR_LOCATION (exp); + tree alias_type, alias_off; if (!validate_arglist (exp, REAL_TYPE, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) @@ -2494,8 +2495,12 @@ expand_builtin_sincos (tree exp) target2 = gen_reg_rtx (mode); op0 = expand_normal (arg); - op1 = expand_normal (build_fold_indirect_ref_loc (loc, sinp)); - op2 = expand_normal (build_fold_indirect_ref_loc (loc, cosp)); + alias_type = build_pointer_type_for_mode (TREE_TYPE (arg), ptr_mode, true); + alias_off = build_int_cst (alias_type, 0); + op1 = expand_normal (fold_build2_loc (loc, MEM_REF, TREE_TYPE (arg), + sinp, alias_off)); + op2 = expand_normal (fold_build2_loc (loc, MEM_REF, TREE_TYPE (arg), + cosp, alias_off)); /* Compute into target1 and target2. Set TARGET to wherever the result comes back. */ |