Re: error in converting macro IS_EXPR_CODE_CLASS() to function

2013-12-29 Thread Prathamesh Kulkarni
On Fri, Dec 27, 2013 at 10:54 PM, Trevor Saunders  wrote:
> On Mon, Dec 23, 2013 at 09:26:41AM -0500, Prathamesh Kulkarni wrote:
>> IS_EXPR_CODE_CLASS() is called at 18 places within gcc subdirectory,
>> and except for expr_check(), tree_block(), tree_set_block() all the
>> other callers pass argument of type enum tree_code_class to
>> IS_EXPR_CODE_CLASS().
>>
>> These four callers (expr_check is overloaded) assign value of
>> TREE_CODE_CLASS() to variable of type char const, and then pass it as
>> argument to IS_EXPR_CODE_CLASS()
>
> that sounds like a bug, or at least a aimed and loaded foot gun
>
>> For example: tree_block():
>> tree
>> tree_block (tree t)
>> {
>>   char const c = TREE_CODE_CLASS (TREE_CODE (t));
>>
>>   if (IS_EXPR_CODE_CLASS (c))
>> return LOCATION_BLOCK (t->exp.locus);
>>   gcc_unreachable ();
>>   return NULL;
>> }
>>
>> Should type of "c" be changed to const enum tree_code_class instead
>> (similarly in other callers) ? Also, TREE_CODE_CLASS()'s value is of
>> type enum tree_code_class.
>
> Well, in that case using a local variable seems pretty useless, why not
> just get rid of it?  However switching the type certainly seems
> reasonable.
In some callers (eg: iterative_hash_expr()), the local variable is
used multiple times.
Getting rid of it, when it's only used once is better.

>
> Trev
>
>>
>> This gave a compile-error: invalid conversion from ‘char’ to 
>> ‘tree_code_class’
>> when i changed the macro IS_EXPR_CODE_CLASS() to the following function:
>>
>> static inline bool
>> IS_EXPR_CODE_CLASS(enum tree_code_class code_class)
>> {
>>   return (code_class >= tcc_reference) && (code_class <= tcc_expression);
>> }
>>
>> Thanks and Regards,
>> Prathamesh


gcc-4.9-20131229 is now available

2013-12-29 Thread gccadmin
Snapshot gcc-4.9-20131229 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.9-20131229/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.9 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/trunk revision 206237

You'll find:

 gcc-4.9-20131229.tar.bz2 Complete GCC

  MD5=f747d0bfc8db97310e9cd55069f418a4
  SHA1=6c302aac88baaf950779f6348b0796db70c5c0e2

Diffs from 4.9-20131222 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.9
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: Question about simple_return pattern for the GCC ARM backend.

2013-12-29 Thread Yangfei (Felix)
Thanks for the reply. I found it in GCC-4.8. 
The gcc version I look at is GCC-4.7. Seems this pattern is not there for this 
version.

> 
> On 2013/12/28 09:31 AM, Yangfei (Felix) wrote:
> > Hi,
> >
> >   I think that simple_return standard pattern is useful for the ARM. I mean
> it should be good for target code performance.
> >  But seems this pattern is not there for the GCC ARM backend. Can anyone
> explain the reason why we don’t need this?
> >
> > Cheers,
> > Fei
> >
> 
> It does use it. Search for the "return" expand pattern, and the
> "returns" code iterator in config/arm/iterators.md.
> 
> Chung-Lin