[Bug middle-end/57955] [9/10/11/12 Regression] Uniquization of constants reduces alignment of initializers

2021-12-23 Thread dje at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57955

--- Comment #26 from David Edelsohn  ---
As Bill mentioned, one can increase the alignment of a large constant, but
there is no way for the hooks that set alignment to recognize that the constant
will be assigned to variable with stricter alignment.

[Bug middle-end/57955] [9/10/11/12 Regression] Uniquization of constants reduces alignment of initializers

2021-12-23 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57955

--- Comment #25 from Eric Botcazou  ---
> Before the gimplification change the initializer {1,} was promoted to a
> static const and given an alignment of 128; due to this part of the code:
> 
> if (align > DECL_ALIGN (new_tree))
>   {
> DECL_ALIGN (new_tree) = align;
> DECL_USER_ALIGN (new_tree) = 1;
>   }
> 
> But now it just uses DATA_ALIGNMENT (the code should be using
> TARGET_CONSTANT_ALIGNMENT but does not right now, that was a proposal).

Yes, exactly.  The initializer is put into the "tree" constant pool, where its
alignment is uniformly set to DATA_ALIGNMENT.

[Bug middle-end/57955] [9/10/11/12 Regression] Uniquization of constants reduces alignment of initializers

2021-12-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57955

--- Comment #24 from Andrew Pinski  ---
Just to summarize this bug as far as I read it, please correct me if I am
wrong; note I am not proposing a change, just trying to summarize the back and
forth since it is not obvious right away of what the problem was.

This was the testcase:
 void foo(void)
 {
  int x[8] __attribute__((aligned(128))) = { 1, 1, 1, 1, 1, 1, 1, 1 };
  bar (x);
 }

Before the gimplification change the initializer {1,} was promoted to a
static const and given an alignment of 128; due to this part of the code:

if (align > DECL_ALIGN (new_tree))
  {
DECL_ALIGN (new_tree) = align;
DECL_USER_ALIGN (new_tree) = 1;
  }

But now it just uses DATA_ALIGNMENT (the code should be using
TARGET_CONSTANT_ALIGNMENT but does not right now, that was a proposal).

rs6000_constant_alignment (TARGET_CONSTANT_ALIGNMENT) only aligns strings csts
to word (32 or 64) aligned. rs6000_data_alignment (DATA_ALIGNMENT) only aligns
vectors to 128 and char arrays to word (32 or 64) align.

[Bug middle-end/57955] [9/10/11/12 Regression] Uniquization of constants reduces alignment of initializers

2021-06-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57955

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|9.4 |9.5

--- Comment #23 from Richard Biener  ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

[Bug middle-end/57955] [9/10/11/12 Regression] Uniquization of constants reduces alignment of initializers

2021-05-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57955

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.5 |9.4

--- Comment #22 from Jakub Jelinek  ---
GCC 8 branch is being closed.