This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR target/40838: gcc shouldn't assume that the stack is aligned


"H.J. Lu" <hjl.tools@gmail.com> writes:

> @@ -947,6 +949,12 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
>              }
>            return false;
>          }
> +
> +      mode = TYPE_MODE (STMT_VINFO_VECTYPE (stmt_info));
> +      align = GET_MODE_ALIGNMENT (mode);
> +      if (cfun->hard_stack_alignment < align)
> +	cfun->hard_stack_alignment = align;
> +
>        if (supportable_dr_alignment != dr_aligned
>            && vect_print_dump_info (REPORT_ALIGNMENT))
>          fprintf (vect_dump, "Vectorizing an unaligned access.");

I do not understand why this is the right place to set your new cfun
field.  Your patch is about a misaligned stack.  The code you are
changing here does not appear to have anything to do with a misaligned
stack.  This code is about the correct alignment of data.  The data
may be on the stack but it need not be.  If the data is on the stack,
then the compiler should be able to determine the alignment available
on the stack.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]