This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Propagation of pointer alignment information
- To: richard dot earnshaw at arm dot com
- Subject: Re: Propagation of pointer alignment information
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Wed, 16 Dec 1998 23:06:45 -0700
- cc: Joern Rennecke <amylaar at cygnus dot co dot uk>, egcs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <199812161354.NAA04076@sun52.NIS.cambridge>you write:
> This makes sense, but taking that route, I think it then makes sense when
> the flag is unset to then turn off all alignment assumptions that are
> inferred via REGNO_POINTER_ALIGN. The patch below does this.
>
> Jeff, is the following patch OK to install?
>
> <date> Richard Earnshaw (rearnsha@arm.com)
>
> * toplev.c (flag_infer_align): New flag.
> (lang_independent_options): Add -finfer-align to list of flags.
> (main): Turn it on when optimizing.
> * flags.h (flag_infer_align): Declare it.
> * emit-rtl.c (mark_reg_pointer): Only set REGNO_POINTER_ALIGN if
> flag_infer_align.
> (init_emit): Note that alignments of stack and frame regs are well
> known, even if flag_infer_align is unset.
> * invoke.texi: Document -finfer-align.
Implementation seems fine.
I'm not a big fan of having lots of options to work around bad user code.
I'm willing to go along with this patch if you think this problem is important
enough to warrant adding the change. But we shouldn't make a habit of hacking
the compiler to work around bugs in user code.
jeff