* [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type
@ 2016-09-25 13:00 Tom de Vries
2016-10-07 15:25 ` Tamar Christina
2016-10-10 9:54 ` Richard Biener
0 siblings, 2 replies; 4+ messages in thread
From: Tom de Vries @ 2016-09-25 13:00 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 754 bytes --]
Hi,
this patch fixes PR77558, an ice-on-invalid-code 6/7 regression.
The fix for PR71602 introduced the invalid-code test-case
c-c++-common/va-arg-va-list-type.c:
...
__builtin_va_list *pap;
void
fn1 (void)
{
__builtin_va_arg (pap, double); /* { dg-error "first argument to
'va_arg' not of type 'va_list'" } */
}
...
The test-case passes for x86_64, but fails for aarch64 and ICEs for arm.
The ICE happens because the patch for PR71602 is incomplete. The patch
tries to be more strict about returning a canonical va_list only for
actual va_lists, but doesn't implement this for structure va_list types,
such as we have for arm, aarch64 and alpha.
This patch adds the missing part, and fixes the ICE.
OK for trunk, 6-branch?
Thanks,
- Tom
[-- Attachment #2: 0001-Remove-RECORD_TYPE-special-casing-in-std_canonical_va_list_type.patch --]
[-- Type: text/x-patch, Size: 893 bytes --]
Remove RECORD_TYPE special-casing in std_canonical_va_list_type
2016-09-25 Tom de Vries <tom@codesourcery.com>
PR middle-end/77558
* builtins.c (std_canonical_va_list_type): Remove RECORD_TYPE
special-casing.
---
gcc/builtins.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 9a19a75..f91e6d3 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4089,10 +4089,8 @@ std_canonical_va_list_type (tree type)
wtype = va_list_type_node;
htype = type;
- /* Treat structure va_list types. */
- if (TREE_CODE (wtype) == RECORD_TYPE && POINTER_TYPE_P (htype))
- htype = TREE_TYPE (htype);
- else if (TREE_CODE (wtype) == ARRAY_TYPE)
+
+ if (TREE_CODE (wtype) == ARRAY_TYPE)
{
/* If va_list is an array type, the argument may have decayed
to a pointer type, e.g. by being passed to another function.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type
2016-09-25 13:00 [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type Tom de Vries
@ 2016-10-07 15:25 ` Tamar Christina
2016-10-10 9:54 ` Richard Biener
1 sibling, 0 replies; 4+ messages in thread
From: Tamar Christina @ 2016-10-07 15:25 UTC (permalink / raw)
To: Tom de Vries, GCC Patches; +Cc: nd
Ping?
Would be great to get this in, it's currently showing up as a major issue on our nightlies.
Cheers,
Tamar
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Tom de Vries
> Sent: 25 September 2016 10:08
> To: GCC Patches
> Subject: [PATCH, PR77558] Remove RECORD_TYPE special-casing in
> std_canonical_va_list_type
>
> Hi,
>
> this patch fixes PR77558, an ice-on-invalid-code 6/7 regression.
>
> The fix for PR71602 introduced the invalid-code test-case
> c-c++-common/va-arg-va-list-type.c:
> ...
> __builtin_va_list *pap;
>
> void
> fn1 (void)
> {
> __builtin_va_arg (pap, double); /* { dg-error "first argument to 'va_arg' not
> of type 'va_list'" } */ } ...
>
> The test-case passes for x86_64, but fails for aarch64 and ICEs for arm.
>
> The ICE happens because the patch for PR71602 is incomplete. The patch
> tries to be more strict about returning a canonical va_list only for actual
> va_lists, but doesn't implement this for structure va_list types, such as we
> have for arm, aarch64 and alpha.
>
> This patch adds the missing part, and fixes the ICE.
>
> OK for trunk, 6-branch?
>
> Thanks,
> - Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type
2016-09-25 13:00 [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type Tom de Vries
2016-10-07 15:25 ` Tamar Christina
@ 2016-10-10 9:54 ` Richard Biener
2016-10-11 12:01 ` Christophe Lyon
1 sibling, 1 reply; 4+ messages in thread
From: Richard Biener @ 2016-10-10 9:54 UTC (permalink / raw)
To: Tom de Vries; +Cc: GCC Patches
On Sun, Sep 25, 2016 at 11:08 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Hi,
>
> this patch fixes PR77558, an ice-on-invalid-code 6/7 regression.
>
> The fix for PR71602 introduced the invalid-code test-case
> c-c++-common/va-arg-va-list-type.c:
> ...
> __builtin_va_list *pap;
>
> void
> fn1 (void)
> {
> __builtin_va_arg (pap, double); /* { dg-error "first argument to 'va_arg'
> not of type 'va_list'" } */
> }
> ...
>
> The test-case passes for x86_64, but fails for aarch64 and ICEs for arm.
>
> The ICE happens because the patch for PR71602 is incomplete. The patch tries
> to be more strict about returning a canonical va_list only for actual
> va_lists, but doesn't implement this for structure va_list types, such as we
> have for arm, aarch64 and alpha.
>
> This patch adds the missing part, and fixes the ICE.
>
> OK for trunk, 6-branch?
Ok.
Richard.
> Thanks,
> - Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type
2016-10-10 9:54 ` Richard Biener
@ 2016-10-11 12:01 ` Christophe Lyon
0 siblings, 0 replies; 4+ messages in thread
From: Christophe Lyon @ 2016-10-11 12:01 UTC (permalink / raw)
To: Tom de Vries; +Cc: GCC Patches
On 10 October 2016 at 11:53, Richard Biener <richard.guenther@gmail.com> wrote:
> On Sun, Sep 25, 2016 at 11:08 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
>> Hi,
>>
>> this patch fixes PR77558, an ice-on-invalid-code 6/7 regression.
>>
>> The fix for PR71602 introduced the invalid-code test-case
>> c-c++-common/va-arg-va-list-type.c:
>> ...
>> __builtin_va_list *pap;
>>
>> void
>> fn1 (void)
>> {
>> __builtin_va_arg (pap, double); /* { dg-error "first argument to 'va_arg'
>> not of type 'va_list'" } */
>> }
>> ...
>>
>> The test-case passes for x86_64, but fails for aarch64 and ICEs for arm.
>>
>> The ICE happens because the patch for PR71602 is incomplete. The patch tries
>> to be more strict about returning a canonical va_list only for actual
>> va_lists, but doesn't implement this for structure va_list types, such as we
>> have for arm, aarch64 and alpha.
>>
>> This patch adds the missing part, and fixes the ICE.
>>
>> OK for trunk, 6-branch?
>
> Ok.
>
Hi Tom,
It seems your patch broke the gcc-6 branch.
I'm seeing build failures (arm*/aarch64* targets):
/tmp/4929309_2.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-linux-gnueabi/gcc2/./gcc/xgcc
-B/tmp/4929309_2.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm
-none-linux-gnueabi/gcc2/./gcc/
-B/tmp/4929309_2.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-linux-gnueabi/bin/
-B/tmp/4929309_2.tmpdir/aci-gcc-fsf/buil
ds/gcc-fsf-gccsrc/tools/arm-none-linux-gnueabi/lib/ -isystem
/tmp/4929309_2.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-linux-gnueabi/include
-isystem /
tmp/4929309_2.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-linux-gnueabi/sys-include
-g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wal
l -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -isystem ./include -fPIC -fno-inline -g
-DIN_LIBGCC2 -fbuilding-lib
gcc -fno-stack-protector -fPIC -fno-inline -I. -I. -I../.././gcc
-I/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc
-I/tmp/4929309_2.tmpdir/aci-gcc
-fsf/sources/gcc-fsf/gccsrc/libgcc/.
-I/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/../gcc
-I/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gc
csrc/libgcc/../include -DHAVE_CC_TLS -o _gcov_execlp.o -MT
_gcov_execlp.o -MD -MP -MF _gcov_execlp.dep -DL_gcov_execlp -c
/tmp/4929309_2.tmpdir/aci-gcc-fsf/source
s/gcc-fsf/gccsrc/libgcc/libgcov-interface.c
In file included from
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/../gcc/tsystem.h:84:0,
from
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/libgcov.h:41,
from
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/libgcov-interface.c:26:
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/libgcov-interface.c:
In function '__gcov_execl':
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/libgcov-interface.c:204:22:
error: first argument to 'va_arg' not of type 'va_list'
while (va_arg (ap, char *))
^
/tmp/4929309_2.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/libgcov-interface.c:211:27:
error: first argument to 'va_arg' not of type 'va_list'
args[i] = va_arg (aq, char *);
^
make[2]: *** [_gcov_execl.o] Error 1
Christophe
> Richard.
>
>> Thanks,
>> - Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-11 12:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-25 13:00 [PATCH, PR77558] Remove RECORD_TYPE special-casing in std_canonical_va_list_type Tom de Vries
2016-10-07 15:25 ` Tamar Christina
2016-10-10 9:54 ` Richard Biener
2016-10-11 12:01 ` Christophe Lyon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).