The following (IMHO valid) testcase triggers an ICE since GCC 4.3.0 (when fixed-point types were introduced): ============================================================ void foo() { asm("" : : "r"(0r)); } ============================================================ bug.c: In function 'foo': bug.c:4: internal compiler error: in init_move_cost, at reginfo.c:270 Please submit a full bug report, [etc.] Technically, this is a regression since the code did not crash the compiler before (because it was rejected earlier).
Similarly __typeof (0r) foo (void) { return 0r; } ICEs on x86-64 and so does _Fract foo (void) { return 0r; } (the last one just as error-recovery ICE). I'd say for !targetm.fixed_point_supported_p () we should remove the loop hole that fixed-point constants introduce fixed point types without any error, similarly for C++ we should reject FIXED_CSTs, and to improve error-recovery, we shouldn't used fixed point types after we've diagnosed we don't support them.
Subject: Bug 39059 Author: jakub Date: Tue Feb 3 17:26:28 2009 New Revision: 143900 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143900 Log: PR inline-asm/39059 * c-parser.c (c_parser_postfix_expression): If fixed point is not supported, don't accept FIXED_CSTs. * c-decl.c (finish_declspecs): Error if fixed point is not supported and _Sat is used without _Fract/_Accum. Set specs->type to integer_type_node for cts_fract/cts_accum if fixed point is not supported. * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs. * gcc.dg/nofixed-point-2.c: New test. * g++.dg/ext/fixed1.C: Adjust expected diagnostics. * g++.dg/ext/fixed2.C: Likewise. * g++.dg/other/error25.C: Likewise. * g++.dg/lookup/crash7.C: Likewise. * g++.dg/cpp0x/decltype-38655.C: Likewise. Added: trunk/gcc/testsuite/gcc.dg/nofixed-point-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/c-parser.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C trunk/gcc/testsuite/g++.dg/ext/fixed1.C trunk/gcc/testsuite/g++.dg/ext/fixed2.C trunk/gcc/testsuite/g++.dg/lookup/crash7.C trunk/gcc/testsuite/g++.dg/other/error25.C
Fixed on the trunk.
GCC 4.3.4 is being released, adjusting target milestone.
GCC 4.3.5 is being released, adjusting target milestone.
Fixed for 4.4.0