[Bug target/82748] ICE with __builtin_fabsq and __float128 in copy_to_mode_reg, at explow.c:612

2017-10-27 Thread gabriel at inconstante dot eti.br
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82748

--- Comment #1 from Gabriel F. T. Gomes  ---
Some additional information:

Replacing __builtin_fabsq (x) with __builtin_copysignq (x, x), in the test
program, causes a similar error.

Replacing the 'q'-suffixed builtin with its 'f128'-suffixed counterpart makes
the error go away.

[Bug target/82748] New: ICE with __builtin_fabsq and __float128 in copy_to_mode_reg, at explow.c:612

2017-10-27 Thread gabriel at inconstante dot eti.br
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82748

Bug ID: 82748
   Summary: ICE with __builtin_fabsq and __float128 in
copy_to_mode_reg, at explow.c:612
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gabriel at inconstante dot eti.br
CC: gabriel at inconstante dot eti.br,
meissner at linux dot vnet.ibm.com
  Target Milestone: ---
Target: powerpc64le-linux-gnu

The following code, when compiled with -mfloat128 -mabi=ieeelongdouble for
powerpc64le-linux-gnu, produces the following ICE.  The error message was
produce with GCC 7.  With GCC 8, it also fails and -mfloat128 is not required. 
With GCC 6 it doesn't fail.

__float128 d;

__float128
foobar (__float128 x)
{
  d = __builtin_fabsq (x);
  return d;
}

gcc: warning: using IEEE extended precision long double
cc1: warning: using IEEE extended precision long double
test.c: In function ‘foobar’:
test.c:6:7: internal compiler error: in copy_to_mode_reg, at explow.c:612
   d = __builtin_fabsq (x);
   ^~~
0x105176af copy_to_mode_reg(machine_mode, rtx_def*)
/home/meissner/fsf-src/gcc-7-branch/gcc/explow.c:612
0x10dbacf3 rs6000_expand_unop_builtin
/home/meissner/fsf-src/gcc-7-branch/gcc/config/rs6000/rs6000.c:14628
0x10e00a93 rs6000_expand_builtin
/home/meissner/fsf-src/gcc-7-branch/gcc/config/rs6000/rs6000.c:17312
0x10383b1b expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
/home/meissner/fsf-src/gcc-7-branch/gcc/builtins.c:6368
0x10539263 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/meissner/fsf-src/gcc-7-branch/gcc/expr.c:10821
0x105483ff store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
/home/meissner/fsf-src/gcc-7-branch/gcc/expr.c:5552
0x1054a10f expand_assignment(tree_node*, tree_node*, bool)
/home/meissner/fsf-src/gcc-7-branch/gcc/expr.c:5321
0x103b509b expand_call_stmt
/home/meissner/fsf-src/gcc-7-branch/gcc/cfgexpand.c:2656
0x103b509b expand_gimple_stmt_1
/home/meissner/fsf-src/gcc-7-branch/gcc/cfgexpand.c:3571
0x103b509b expand_gimple_stmt
/home/meissner/fsf-src/gcc-7-branch/gcc/cfgexpand.c:3737
0x103bc327 expand_gimple_basic_block
/home/meissner/fsf-src/gcc-7-branch/gcc/cfgexpand.c:5744
0x103bf467 execute
/home/meissner/fsf-src/gcc-7-branch/gcc/cfgexpand.c:6357
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.