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 Fri, Mar 6, 2009 at 2:32 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Mar 6, 2009 at 8:53 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Mar 6, 2009 at 7:53 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> On Fri, Mar 6, 2009 at 4:42 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Thu, Mar 05, 2009 at 04:20:40PM +0100, Richard Guenther wrote:
>>>>>
>>>>> As I said in my original mail align will pack with pointer_alias_set
>>>>> so size of tree_decl_common should be unchanged on 64bit hosts
>>>>> at least (and grow 32bit on 32bit hosts).
>>>>>
>>>>
>>>> Here is the updated patch. It includes
>>>>
>>>> - ?else if (i > HOST_BITS_PER_INT - 2)
>>>> + ?else if (i > HOST_BITS_PER_INT - 4)
>>>>
>>>> Otherwise (1 << i) * BITS_PER_UNIT may overflow int. ?It also
>>>
>>> I think BITS_PER_UNIT can be different than 8 (though it seems
>>> we have lost all targets doing that), so - exact_log2 (BITS_PER_UNIT)
>>> would be better here.
>>>
>>> Ok for 4.5 with that change.
>>>
>>
>> Here is the updated patch. I used BITS_PER_UNIT_LOG instead
>> of exact_log2 (BITS_PER_UNIT). I also changed some alignment
>> variables to "unsigned int" to avoid signed/unsigned comparison
>> warnings. I am testing this on Linux/Intel64 with all languages
>> enabled as well as on Linux/ia32, Linux/ia64 and Linux/Intel64 with
>> default languages enabled. OK for 4.5 if there are no regressions?
>
> Ok. ?Though I cannot approve the Ada part (maybe you can consider it
> obvious).
>
> Thanks,
> Richard.
>
>> Thanks.
>>
>> --
>> H.J.
>> ----
>> gcc/
>>
>> 2009-03-06 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>
>> ? ? ? ?PR c/39323
>> ? ? ? ?* c-common.c (handle_aligned_attribute): Properly check alignment
>> ? ? ? ?overflow. ?Use (1U << i) instead of (1 << i).
>>
>> ? ? ? ?* emit-rtl.c (get_mem_align_offset): Use "unsigned int" for
>> ? ? ? ?align.
>>
>> ? ? ? ?* expr.h (get_mem_align_offset): Updated.
>>
>> ? ? ? ?* tree.h (tree_decl_common): Change align to "unsigned int" and
>> ? ? ? ?move it before pointer_alias_set.
>>
>> ? ? ? ?* config/i386/i386.c (expand_constant_movmem_prologue): Use
>> ? ? ? ?"unsigned int" for desired_align.
>> ? ? ? ?(ix86_expand_movmem): Likewise.
>>
>> gcc/ada/
>>
>> 2009-03-06 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>
>> ? ? ? ?PR c/39323
>> ? ? ? ?* gcc-interface/utils.c (create_field_decl): Use "unsigned int"
>> ? ? ? ?on bit_align.
>>
>> gcc/testsuite/
>>
>> 2009-03-06 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>
>> ? ? ? ?PR c/39323
>> ? ? ? ?* gcc.dg/pr39323-1.c: New.
>> ? ? ? ?* gcc.dg/pr39323-2.c: Likewise.
>> ? ? ? ?* gcc.dg/pr39323-3.c: Likewise.
>>
>

This is the final patch.  I had to revert i386..c change.  There are
no regressions
on Linux/ia32, Linux/ia64 and Linux/Intel64.  On Linux/Inte64, there are 175 Ada
failures. I will try again with unpatched gcc.


-- 
H.J.
---
gcc/

2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/39323
	* c-common.c (handle_aligned_attribute): Properly check alignment
	overflow.  Use (1U << i) instead of (1 << i).

	* emit-rtl.c (get_mem_align_offset): Use "unsigned int" for
	align.

	* expr.h (get_mem_align_offset): Updated.

	* tree.h (tree_decl_common): Change align to "unsigned int" and
	move it before pointer_alias_set.

gcc/ada/

2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/39323
	* gcc-interface/utils.c (create_field_decl): Use "unsigned int"
	on bit_align.

gcc/testsuite/

2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/39323
	* gcc.dg/pr39323-1.c: New.
	* gcc.dg/pr39323-2.c: Likewise.
	* gcc.dg/pr39323-3.c: Likewise.

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


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