Patchwork wide-int branch now up for public comment and review

login
register
mail settings
Submitter Richard Sandiford
Date Sept. 1, 2013, 7:25 p.m.
Message ID <87sixobaym.fsf@talisman.default>
Download mbox | patch
Permalink /patch/271636/
State New
Headers show

Comments

Richard Sandiford - Sept. 1, 2013, 7:25 p.m.
Mike Stump <mikestump@comcast.net> writes:
> @@ -643,12 +653,14 @@ equality.  */
>  			       __FUNCTION__);				\
>       &_rtx->u.hwint[_n]; }))
>  
> -#define XHWIVEC_ELT(HWIVEC, I) __extension__				\
> -(*({ __typeof (HWIVEC) const _hwivec = (HWIVEC); const int _i = (I);	\
> -     if (_i < 0 || _i >= HWI_GET_NUM_ELEM (_hwivec))			\
> -       hwivec_check_failed_bounds (_hwivec, _i, __FILE__, __LINE__,	\
> -				  __FUNCTION__);			\
> -     &_hwivec->elem[_i]; }))
> +#define CWI_ELT(RTX, I) __extension__					\
> +(*({ __typeof (RTX) const _rtx = (RTX);					\
> +     int _max = CWI_GET_NUM_ELEM (_rtx);				\

CWI_GET_NUM_ELEM also uses "_rtx" for its temporary variable, so the
last line includes the equivalent of:

  __typeof (_rtx) _rtx = _rtx;

Is the fix below OK?  We do a similar thing for block symbols, etc.

Thanks,
Richard
Richard Sandiford - Sept. 5, 2013, 9 p.m.
Ping.  I should have said that bootstrapping with rtl checking enabled
is broken as things stand.

Thanks,
Richard

Richard Sandiford <rdsandiford@googlemail.com> writes:
> Mike Stump <mikestump@comcast.net> writes:
>> @@ -643,12 +653,14 @@ equality.  */
>>  			       __FUNCTION__);				\
>>       &_rtx->u.hwint[_n]; }))
>>  
>> -#define XHWIVEC_ELT(HWIVEC, I) __extension__				\
>> -(*({ __typeof (HWIVEC) const _hwivec = (HWIVEC); const int _i = (I);	\
>> -     if (_i < 0 || _i >= HWI_GET_NUM_ELEM (_hwivec))			\
>> -       hwivec_check_failed_bounds (_hwivec, _i, __FILE__, __LINE__,	\
>> -				  __FUNCTION__);			\
>> -     &_hwivec->elem[_i]; }))
>> +#define CWI_ELT(RTX, I) __extension__					\
>> +(*({ __typeof (RTX) const _rtx = (RTX);					\
>> +     int _max = CWI_GET_NUM_ELEM (_rtx);				\
>
> CWI_GET_NUM_ELEM also uses "_rtx" for its temporary variable, so the
> last line includes the equivalent of:
>
>   __typeof (_rtx) _rtx = _rtx;
>
> Is the fix below OK?  We do a similar thing for block symbols, etc.
>
> Thanks,
> Richard
>
>
> Index: gcc/rtl.h
> ===================================================================
> --- gcc/rtl.h	2013-09-01 14:00:21.032885857 +0100
> +++ gcc/rtl.h	2013-09-01 17:41:49.474023618 +0100
> @@ -654,13 +654,13 @@ #define XWINT(RTX, N) __extension__
>       &_rtx->u.hwint[_n]; }))
>  
>  #define CWI_ELT(RTX, I) __extension__					\
> -(*({ __typeof (RTX) const _rtx = (RTX);					\
> -     int _max = CWI_GET_NUM_ELEM (_rtx);				\
> +(*({ __typeof (RTX) const _cwi = (RTX);					\
> +     int _max = CWI_GET_NUM_ELEM (_cwi);				\
>       const int _i = (I);						\
>       if (_i < 0 || _i >= _max)						\
> -       cwi_check_failed_bounds (_rtx, _i, __FILE__, __LINE__,	\
> +       cwi_check_failed_bounds (_cwi, _i, __FILE__, __LINE__,		\
>  				__FUNCTION__);				\
> -     &_rtx->u.hwiv.elem[_i]; }))
> +     &_cwi->u.hwiv.elem[_i]; }))
>  
>  #define XCWINT(RTX, N, C) __extension__					\
>  (*({ __typeof (RTX) const _rtx = (RTX);					\
Mike Stump - Sept. 6, 2013, 12:10 a.m.
On Sep 5, 2013, at 2:00 PM, Richard Sandiford <rdsandiford@googlemail.com> wrote:
> Ping.  I should have said that bootstrapping with rtl checking enabled
> is broken as things stand.

Yes, this is fine.

> Richard Sandiford <rdsandiford@googlemail.com> writes:
>> Mike Stump <mikestump@comcast.net> writes:
>>> @@ -643,12 +653,14 @@ equality.  */
>>> 			       __FUNCTION__);				\
>>>      &_rtx->u.hwint[_n]; }))
>>> 
>>> -#define XHWIVEC_ELT(HWIVEC, I) __extension__				\
>>> -(*({ __typeof (HWIVEC) const _hwivec = (HWIVEC); const int _i = (I);	\
>>> -     if (_i < 0 || _i >= HWI_GET_NUM_ELEM (_hwivec))			\
>>> -       hwivec_check_failed_bounds (_hwivec, _i, __FILE__, __LINE__,	\
>>> -				  __FUNCTION__);			\
>>> -     &_hwivec->elem[_i]; }))
>>> +#define CWI_ELT(RTX, I) __extension__					\
>>> +(*({ __typeof (RTX) const _rtx = (RTX);					\
>>> +     int _max = CWI_GET_NUM_ELEM (_rtx);				\
>> 
>> CWI_GET_NUM_ELEM also uses "_rtx" for its temporary variable, so the
>> last line includes the equivalent of:
>> 
>>  __typeof (_rtx) _rtx = _rtx;
>> 
>> Is the fix below OK?  We do a similar thing for block symbols, etc.
>> 
>> Thanks,
>> Richard
>> 
>> 
>> Index: gcc/rtl.h
>> ===================================================================
>> --- gcc/rtl.h	2013-09-01 14:00:21.032885857 +0100
>> +++ gcc/rtl.h	2013-09-01 17:41:49.474023618 +0100
>> @@ -654,13 +654,13 @@ #define XWINT(RTX, N) __extension__
>>      &_rtx->u.hwint[_n]; }))
>> 
>> #define CWI_ELT(RTX, I) __extension__					\
>> -(*({ __typeof (RTX) const _rtx = (RTX);					\
>> -     int _max = CWI_GET_NUM_ELEM (_rtx);				\
>> +(*({ __typeof (RTX) const _cwi = (RTX);					\
>> +     int _max = CWI_GET_NUM_ELEM (_cwi);				\
>>      const int _i = (I);						\
>>      if (_i < 0 || _i >= _max)						\
>> -       cwi_check_failed_bounds (_rtx, _i, __FILE__, __LINE__,	\
>> +       cwi_check_failed_bounds (_cwi, _i, __FILE__, __LINE__,		\
>> 				__FUNCTION__);				\
>> -     &_rtx->u.hwiv.elem[_i]; }))
>> +     &_cwi->u.hwiv.elem[_i]; }))
>> 
>> #define XCWINT(RTX, N, C) __extension__					\
>> (*({ __typeof (RTX) const _rtx = (RTX);					\

Patch

Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	2013-09-01 14:00:21.032885857 +0100
+++ gcc/rtl.h	2013-09-01 17:41:49.474023618 +0100
@@ -654,13 +654,13 @@  #define XWINT(RTX, N) __extension__
      &_rtx->u.hwint[_n]; }))
 
 #define CWI_ELT(RTX, I) __extension__					\
-(*({ __typeof (RTX) const _rtx = (RTX);					\
-     int _max = CWI_GET_NUM_ELEM (_rtx);				\
+(*({ __typeof (RTX) const _cwi = (RTX);					\
+     int _max = CWI_GET_NUM_ELEM (_cwi);				\
      const int _i = (I);						\
      if (_i < 0 || _i >= _max)						\
-       cwi_check_failed_bounds (_rtx, _i, __FILE__, __LINE__,	\
+       cwi_check_failed_bounds (_cwi, _i, __FILE__, __LINE__,		\
 				__FUNCTION__);				\
-     &_rtx->u.hwiv.elem[_i]; }))
+     &_cwi->u.hwiv.elem[_i]; }))
 
 #define XCWINT(RTX, N, C) __extension__					\
 (*({ __typeof (RTX) const _rtx = (RTX);					\