Commit 0f9904a
committed
d: Fix ICE in gimplify_var_or_parm_decl, at gimplify.cc:3308
The result type of the assert() should always be the same as its
inferred expression type, which could either be `void' or `noreturn'.
Also moves the pattern of calling to BUILT_IN_TRAP to its own codegen
function, as it is repeated quite enough throughout the front-end.
PR d/124922
gcc/d/ChangeLog:
* d-codegen.cc (build_trap_call): New function.
(build_array_bounds_call): Use it.
(build_bounds_index_condition): Likewise.
(build_bounds_slice_condition): Likewise.
(d_build_call): Likewise.
* expr.cc (ExprVisitor::visit (HaltExp *)): Likewise.
(ExprVisitor::visit (AssertExp *)): Likewise. Return zero instead of
void_node when assert contracts are disabled.
* d-tree.h (build_trap_call): New prototype.
gcc/testsuite/ChangeLog:
* gdc.dg/pr124922.d: New test.1 parent 9e3e6ce commit 0f9904a
4 files changed
Lines changed: 30 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2007 | 2007 | | |
2008 | 2008 | | |
2009 | 2009 | | |
2010 | | - | |
| 2010 | + | |
2011 | 2011 | | |
2012 | 2012 | | |
2013 | 2013 | | |
| |||
2036 | 2036 | | |
2037 | 2037 | | |
2038 | 2038 | | |
2039 | | - | |
| 2039 | + | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | 2042 | | |
| |||
2082 | 2082 | | |
2083 | 2083 | | |
2084 | 2084 | | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
| 2085 | + | |
2089 | 2086 | | |
2090 | 2087 | | |
2091 | 2088 | | |
| |||
2156 | 2153 | | |
2157 | 2154 | | |
2158 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
2159 | 2164 | | |
2160 | 2165 | | |
2161 | 2166 | | |
| |||
2397 | 2402 | | |
2398 | 2403 | | |
2399 | 2404 | | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
2400 | 2409 | | |
2401 | 2410 | | |
2402 | 2411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
1786 | | - | |
1787 | | - | |
| 1786 | + | |
1788 | 1787 | | |
1789 | 1788 | | |
1790 | 1789 | | |
1791 | 1790 | | |
1792 | | - | |
| 1791 | + | |
1793 | 1792 | | |
1794 | 1793 | | |
1795 | 1794 | | |
| |||
1905 | 1904 | | |
1906 | 1905 | | |
1907 | 1906 | | |
1908 | | - | |
1909 | | - | |
| 1907 | + | |
1910 | 1908 | | |
1911 | 1909 | | |
1912 | 1910 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments