diff mbox

RFA (libstdc++): PATCH to implement C++17 over-aligned new

Message ID CADzB+2kosgCYoX_Mj8mEyVXcAyub2spZUr4DuUzaD+FqOArEVg@mail.gmail.com
State New
Headers show

Commit Message

Jason Merrill Sept. 15, 2016, 7:48 p.m. UTC
OK, one more:

On Thu, Sep 15, 2016 at 8:12 AM, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> On 15 September 2016 at 11:26, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>> Hi Jason,
>>
>>>> I confirm no change on arm* either.
>>>> On aarch64, gen-attrs-[25]1.C, and devirt-33 now work.
>>>> name-clash11.C still fails on both targets
>>>
>>> Ah, I needed to remove the limit on field alignment as well.  This
>>> seems to fix things.
>>
>> The failures are gone on Solaris/SPARC (sparc-sun-solaris2.12) now, with
>> one exception (when run as C test):
>>
>> 32-bit:
>>
>> FAIL: c-c++-common/pr52181.c  -Wc++-compat   (test for bogus messages, line 11)
>> FAIL: c-c++-common/pr52181.c  -Wc++-compat  (test for excess errors)
>>
>
> Hi Jason,
>
> Same on arm* if that's easier for you.
>
> Christophe
>
>
>> This is new with you last patch.
>>
>> Excess errors:
>> /vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/pr52181.c:6:1: warning: requested alignment 16 is larger than 8 [-Wattributes]
>> /vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/pr52181.c:8:1: warning: requested alignment 16 is larger than 8 [-Wattributes]
>>
>>         Rainer
>>
>> --
>> -----------------------------------------------------------------------------
>> Rainer Orth, Center for Biotechnology, Bielefeld University
commit 1a1beb3ab1279f83d411e96d7b5abbf7875c7956
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Sep 15 12:30:03 2016 -0400

            * c-common.c (check_cxx_fundamental_alignment_constraints): Check
            DECL_EXTERNAL.

Comments

Rainer Orth Sept. 16, 2016, 7:04 a.m. UTC | #1
Hi Jason,

> OK, one more:

this works just fine on both sparc-sun-solaris2.12 and
i386-pc-solaris2.12.

Once Jonathan's patch to heed aligned_alloc's requirement on size being
a multiple of alignment is in, all is fine on Solaris.

Thanks.
	Rainer
Christophe Lyon Sept. 16, 2016, 7:25 a.m. UTC | #2
On 16 September 2016 at 09:04, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> Hi Jason,
>
>> OK, one more:
>
> this works just fine on both sparc-sun-solaris2.12 and
> i386-pc-solaris2.12.
>
> Once Jonathan's patch to heed aligned_alloc's requirement on size being
> a multiple of alignment is in, all is fine on Solaris.
>
> Thanks.
>         Rainer
>

It looks OK on arm now too, thanks.

Christophe

> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
diff mbox

Patch

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 57b6671..fc25686 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7870,7 +7870,7 @@  check_cxx_fundamental_alignment_constraints (tree node,
 
   if (VAR_P (node))
     {
-      if (TREE_STATIC (node))
+      if (TREE_STATIC (node) || DECL_EXTERNAL (node))
 	/* For file scope variables and static members, the target supports
 	   alignments that are at most MAX_OFILE_ALIGNMENT.  */
 	max_align = MAX_OFILE_ALIGNMENT;