Summary: | [6 Regression] Segfault when compiling __simd64_float16_t using arm-none-eabi-g++ with debug information | ||
---|---|---|---|
Product: | gcc | Reporter: | avieira |
Component: | debug | Assignee: | Aldy Hernandez <aldyh> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aldyh |
Priority: | P3 | ||
Version: | 6.2.1 | ||
Target Milestone: | 6.3 | ||
Host: | Target: | arm-none-eabi | |
Build: | Known to work: | 5.4.1 | |
Known to fail: | 6.1.1, 6.2.1 | Last reconfirmed: | 2016-09-28 00:00:00 |
Attachments: | proposed patch |
Description
avieira
2016-09-28 10:35:51 UTC
When I say without errors I meant without segfaulting. It will print out the following error for version 5 if you dont include '-mfpu=neon': t.c:1:9: error: '__simd64_float16_t' does not name a type typedef __simd64_float16_t float16x4_t; Confirmed Just to make it clear: The command I showed without the '-g' did use to error on gcc-5, but it doesnt on 6 and 7: $ gcc-5/arm-none-eabi-g++ -S t.c -mfloat-abi=hard -march=armv7-a t.c:1:9: error: '__simd64_float16_t' does not name a type typedef __simd64_float16_t float16x4_t; $ gcc-6/arm-none-eabi-g++ -S t.c -mfloat-abi=hard -march=armv7-a $ gcc-7/arm-none-eabi-g++ -S t.c -mfloat-abi=hard -march=armv7-a Adding -mfpu=neon to gcc-5 gets rid of the error: $ gcc-5/arm-none-eabi-g++ -S t.c -mfloat-abi=hard -march=armv7-a -mfpu=neon Adding -mfpu=neon to eitehr gcc-6 or 7 is irrelevant to both compilations with or without '-g'. Created attachment 39901 [details]
proposed patch
simple_type_specificer() is dereferencing a NULL result from c_common_type_for_mode and segfaulting: int prec = TYPE_PRECISION (t); if (ALL_FIXED_POINT_MODE_P (TYPE_MODE (t))) t = c_common_type_for_mode (TYPE_MODE (t), TYPE_SATURATING (t)); else t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t)); if (TYPE_NAME (t)) The type in question is: <real_type 0x7fffefdeb150 HF size <integer_cst 0x7fffefd002a0 type <integer_type 0x7fffefcf0150 bitsizetype> constant 16> unit size <integer_cst 0x7fffefd002b8 type <integer_type 0x7fffefcf00a8 sizetype> constant 2> align 16 symtab 0 alias set -1 canonical type 0x7fffefdeb150 precision 16 pointer_to_this <pointer_type 0x7fffefeab7e0>> which corresponds to HFmode, which AFAICT does not have a type by design. The attached patch fixes the problem. Author: aldyh Date: Fri Oct 28 16:41:29 2016 New Revision: 241653 URL: https://gcc.gnu.org/viewcvs?rev=241653&root=gcc&view=rev Log: PR debug/77773 * c-pretty-print.c (simple_type_specifier): Do not dereference `t' if NULL. Modified: trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-pretty-print.c Fixed in mainline. Removed tags for GCC 7 regression. Author: aldyh Date: Fri Oct 28 18:34:25 2016 New Revision: 241657 URL: https://gcc.gnu.org/viewcvs?rev=241657&root=gcc&view=rev Log: PR debug/77773 * c-pretty-print.c (simple_type_specifier): Do not dereference `t' if NULL. Modified: branches/gcc-6-branch/gcc/c-family/ChangeLog branches/gcc-6-branch/gcc/c-family/c-pretty-print.c Fixed in gcc6 branch as well. Closing. |