Bug 89521 - ICE in expand_builtin_int_roundingfn, at builtins.c:2697
Summary: ICE in expand_builtin_int_roundingfn, at builtins.c:2697
Status: RESOLVED DUPLICATE of bug 89520
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-27 17:28 UTC by G. Steinmetz
Modified: 2019-08-30 12:12 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2019-02-27 17:28:17 UTC
A variation of pr89520 (closely related, but possibly valid) :


$ cat z1.c
double ceil ();
double floor ();
long aceil () { return ceil (1); }
long afloor () { return floor (1); }


$ gcc-9-20190224 -c z1.c -O2
z1.c: In function 'aceil':
z1.c:3:30: warning: 'ceil' argument 1 type is 'int' where 'double' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    3 | long aceil () { return ceil (1); }
      |                              ^
z1.c:1:8: note: built-in 'ceil' declared here
    1 | double ceil ();
      |        ^~~~
z1.c: In function 'afloor':
z1.c:4:32: warning: 'floor' argument 1 type is 'int' where 'double' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    4 | long afloor () { return floor (1); }
      |                                ^
z1.c:2:8: note: built-in 'floor' declared here
    2 | double floor ();
      |        ^~~~~
during RTL pass: expand
z1.c: In function 'aceil':
z1.c:3:24: internal compiler error: in expand_builtin_int_roundingfn, at builtins.c:2697
    3 | long aceil () { return ceil (1); }
      |                        ^~~~~~~~
0x73714c expand_builtin_int_roundingfn
        ../../gcc/builtins.c:2697
0x74c390 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        ../../gcc/builtins.c:7332
0x8a9b86 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
        ../../gcc/expr.c:11029
0x8b5936 store_expr(tree_node*, rtx_def*, int, bool, bool)
        ../../gcc/expr.c:5673
0x8b7228 expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc/expr.c:5436
0x772112 expand_call_stmt
        ../../gcc/cfgexpand.c:2722
0x772112 expand_gimple_stmt_1
        ../../gcc/cfgexpand.c:3691
0x772112 expand_gimple_stmt
        ../../gcc/cfgexpand.c:3850
0x774cd8 expand_gimple_tailcall
        ../../gcc/cfgexpand.c:3897
0x774cd8 expand_gimple_basic_block
        ../../gcc/cfgexpand.c:5863
0x77abde execute
        ../../gcc/cfgexpand.c:6509
Comment 1 Jakub Jelinek 2019-02-28 13:50:10 UTC
Author: jakub
Date: Thu Feb 28 13:49:38 2019
New Revision: 269280

URL: https://gcc.gnu.org/viewcvs?rev=269280&root=gcc&view=rev
Log:
	PR c/89521
	* gcc.dg/pr89521-1.c: New test.
	* gcc.dg/pr89521-2.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr89521-1.c
    trunk/gcc/testsuite/gcc.dg/pr89521-2.c
Modified:
    trunk/gcc/testsuite/ChangeLog
Comment 2 Jakub Jelinek 2019-02-28 13:51:48 UTC
The PR89520 fix actually fixed this one too.

*** This bug has been marked as a duplicate of bug 89520 ***
Comment 3 Jakub Jelinek 2019-04-30 20:35:20 UTC
Author: jakub
Date: Tue Apr 30 20:34:49 2019
New Revision: 270718

URL: https://gcc.gnu.org/viewcvs?rev=270718&root=gcc&view=rev
Log:
	Backported from mainline
	2019-02-28  Jakub Jelinek  <jakub@redhat.com>

	PR c/89521
	* gcc.dg/pr89521-1.c: New test.
	* gcc.dg/pr89521-2.c: New test.

Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/pr89521-1.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/pr89521-2.c
Modified:
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
Comment 4 Jakub Jelinek 2019-08-30 12:12:10 UTC
Author: jakub
Date: Fri Aug 30 12:11:38 2019
New Revision: 275121

URL: https://gcc.gnu.org/viewcvs?rev=275121&root=gcc&view=rev
Log:
	Backported from mainline
	2019-02-28  Jakub Jelinek  <jakub@redhat.com>

	PR c/89521
	* gcc.dg/pr89521-1.c: New test.
	* gcc.dg/pr89521-2.c: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr89521-1.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr89521-2.c
Modified:
    branches/gcc-7-branch/gcc/testsuite/ChangeLog