This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386, Pointer Bounds Checker 30/x] Size relocation
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Enkovich, Ilya" <ilya dot enkovich at intel dot com>
- Date: Wed, 1 Oct 2014 21:02:47 +0400
- Subject: Re: [PATCH, i386, Pointer Bounds Checker 30/x] Size relocation
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4avH2BWgAvDJhvU1TwRpDSdAUAwBLdRR3Qd8VTeF8rx_g at mail dot gmail dot com> <CAMbmDYbmV5hmUME1WEeEVQZ13dpRAt5a3VRompfZi8YxhZ35_A at mail dot gmail dot com> <CAFULd4Ym34U=-yfP_RszZ6CG-J2xgoPjBbs3Ezbh=1OTQOjkAw at mail dot gmail dot com> <20140917183534 dot GD3628 at msticlxl57 dot ims dot intel dot com> <CAFULd4YZi7S4+=7_N2vv0XFXiJ4Cj=hOymOAsOYmSSnJF2__AQ at mail dot gmail dot com> <20140918140033 dot GB50194 at msticlxl57 dot ims dot intel dot com> <CAMbmDYYBG2SQLVUZemMhM2zBv+OgrZ0wiq8CN4waDe-cvN10sw at mail dot gmail dot com> <CAFULd4aEaucEqrNEe2EWQp6mmFMLUYXXC9567x4H7YP605-UYw at mail dot gmail dot com>
2014-10-01 19:17 GMT+04:00 Uros Bizjak <ubizjak@gmail.com>:
> On Wed, Oct 1, 2014 at 4:10 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>
>>> +;; Return true if size of VALUE can be stored in a sign
>>> +;; extended immediate field.
>>> +(define_predicate "x86_64_immediate_size_operand"
>>> + (match_code "symbol_ref")
>>> +{
>>> + if (!TARGET_64BIT)
>>> + return true;
>>> +
>>> + /* For 64 bit target we may assume size of object fits
>>> + immediate only when code model guarantees that. */
>>> + return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL);
>>> +})
>>> +
>>
>> This predicate causes bootstrap error:
>> predicates.md:362:38: error: unused parameter 'op' [-Werror=unused-parameter]
>
> Huh? How is this predicate different from e.g.
>
> (define_predicate "compare_operator"
> (match_code "compare"))
>
> ?
>
> Can you please show generated code from gcc/insn-preds.c?
>
> Uros.
It is different because it has a code block which is used to generate
additional function. Here is what generated for the predicate:
static inline int
x86_64_immediate_size_operand_1 (rtx op, enum machine_mode mode
ATTRIBUTE_UNUSED)
{
if (!TARGET_64BIT)
return true;
/* For 64 bit target we may assume size of object fits
immediate only when code model guarantees that. */
return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL);
}
int
x86_64_immediate_size_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == SYMBOL_REF) && (
(x86_64_immediate_size_operand_1 (op, mode)))) && (
(mode == VOIDmode || GET_MODE (op) == mode));
}
Ilya