This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR58944
- From: Sriraman Tallam <tmsriram at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, Uros Bizjak <ubizjak at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, David Li <davidxl at google dot com>
- Date: Tue, 17 Dec 2013 10:29:03 -0800
- Subject: Re: [PATCH] Fix PR58944
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmyLUO011WwGLzR1-92BLkoL9tUtGBAhJw0m42b3xtnkJg at mail dot gmail dot com> <CAFULd4Z_emn3Et-Dq2aTbnU-whR+FwAohQjOBrGw2oQ8-Gj1kw at mail dot gmail dot com> <DUB122-W22D14A97C0DB412CDF3D07E4E90 at phx dot gbl> <CAAs8HmxGP4iAEvZ28hAeh_WomZmr9vJJXJQr35R9d9PyHoLO3Q at mail dot gmail dot com> <CAMe9rOps+duRb44NXM-nhqqHQGppdK1U9zmXd7_B9AiUpfKbYA at mail dot gmail dot com>
On Fri, Dec 13, 2013 at 5:06 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Dec 2, 2013 at 6:46 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>> On Thu, Nov 28, 2013 at 9:36 PM, Bernd Edlinger
>> <bernd.edlinger@hotmail.de> wrote:
>>> Hi,
>>>
>>> On Wed, 27 Nov 2013 19:49:39, Uros Bizjak wrote:
>>>>
>>>> On Mon, Nov 25, 2013 at 10:08 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>>
>>>>> I have attached a patch to fix this bug :
>>>>>
>>>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944
>>>>>
>>>>> A similar problem was also reported here:
>>>>> http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01050.html
>>>>>
>>>>>
>>>>> Recently, ix86_valid_target_attribute_tree in config/i386/i386.c was
>>>>> refactored to not depend on global_options structure and to be able to
>>>>> use any gcc_options structure. One clean way to fix this is by having
>>>>> target_option_default_node save all the default target options which
>>>>> can be restored to any gcc_options structure. The root cause of the
>>>>> above bugs was that ix86_arch_string and ix86_tune_string was not
>>>>> saved in target_option_deault_node in PR58944 and
>>>>> ix86_preferred_stack_boundary_arg was not saved in the latter case.
>>>>>
>>>>> This patch saves all the target options used in i386.opt which are
>>>>> either obtained from the command-line or set to some default. Is this
>>>>> patch alright?
>>>>
>>>> Things looks rather complicated, but I see no other solution that save
>>>> and restore the way you propose.
>>>>
>>>> Please wait 24h if somebody has a different idea, otherwise please go
>>>> ahead and commit the patch to mainline.
>>>>
>>>
>>> Maybe you should also look at the handling or preferred_stack_boundary_arg
>>> versus incoming_stack_boundary_arg in ix86_option_override_internal:
>>>
>>> Remember ix86_incoming_stack_boundary_arg is defined to
>>> global_options.x_ix86_incoming_stack_boundary_arg.
>>>
>>> like this?
>>>
>>> if (opts_set->x_ix86_incoming_stack_boundary_arg)
>>> {
>>> - if (ix86_incoming_stack_boundary_arg
>>> + if (opts->x_ix86_incoming_stack_boundary_arg
>>> < (TARGET_64BIT_P (opts->x_ix86_isa_flags) ? 4 : 2)
>>> - || ix86_incoming_stack_boundary_arg> 12)
>>> + || opts->x_ix86_incoming_stack_boundary_arg> 12)
>>> error ("-mincoming-stack-boundary=%d is not between %d and 12",
>>> - ix86_incoming_stack_boundary_arg,
>>> + opts->x_ix86_incoming_stack_boundary_arg,
>>> TARGET_64BIT_P (opts->x_ix86_isa_flags) ? 4 : 2);
>>> else
>>> {
>>> ix86_user_incoming_stack_boundary
>>> - = (1 << ix86_incoming_stack_boundary_arg) * BITS_PER_UNIT;
>>> + = (1 << opts->x_ix86_incoming_stack_boundary_arg) * BITS_PER_UNIT;
>>> ix86_incoming_stack_boundary
>>> = ix86_user_incoming_stack_boundary;
>>> }
>>>
>>
>> Thanks for catching this. I will make this change in the same patch.
>>
>
> Your change caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59492
Thanks for fixing this. This is making me wonder if I am missing some
other important flags. Is there a way to detect this? I originally
looked at everything in i386.opt to form my list.
Thanks
Sri
>
>
> --
> H.J.