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: [4.5] PATCH: PR c/39323: MAX_OFILE_ALIGNMENT in elfos.h is too big


On Mon, Mar 2, 2009 at 4:21 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> I noticed this issue while working on
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39315
>>
>> Its fix:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01267.html
>>
>> has been approved for 4.5. ?Since MAX_OFILE_ALIGNMENT is
>> too big on Linux, in theory, expand_one_stack_var_at can overflow
>> DECL_ALIGN. In practice, it may never happen. I added a check
>>
>> + ?/* There should be no alignment overflow. ?*/
>> + ?if (DECL_ALIGN (decl) != align)
>> + ? ?gcc_unreachable ();
>>
>> in expand_one_stack_var_at. ?OK for 4.5?
>
> User input should never cause gcc to call gcc_unreachable().

I don't like it either.

> It would be fine for 4.5 to call error(), or maybe it would be better to
> call sorry().
>

Here is the updated patch.  It accesses decl_common.align directly
to check for overflow.  Or I can use sorry() in expand_one_stack_var_at.

-- 
H.J.

Attachment: gcc-pr39323-3.patch
Description: Text document


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