PING [PATCH]FIX PR30243 signbit Lowpart ICE on AVR target - need Middle end approval.

hutchinsonandy@aim.com hutchinsonandy@aim.com
Fri May 30 13:59:00 GMT 2008


PING Maybe this was overlooked as pesky AVR target change.

Is this ok?


-------- Original Message --------
Subject: [PATCH]FIX PR30243 signbit Lowpart ICE on AVR target
Date: Thu, 15 May 2008 22:51:04 -0400
From: Andy H <hutchinsonandy@aim.com>
To: gcc-patches@gcc.gnu.org
CC: Weddington, Eric <eweddington@cso.atmel.com>, Anatoly Sokolov 
<aesok@post.ru>



This patch corrects ICE bug with AVR and builtin signbit()

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30243

internal compiler error: in gen_lowpart_general, at rtlhooks.c:51

This occurs because expand_builtin_signbit () uses lowpart on
intermediate result register that is already smaller than the expected 
"word" mode.

The change skips the lowpart when its already an equal or smaller mode.


This patch was originally posted against bug by Anatoly Sokolov and Eric
Weddington last October and last revised in February.
Although used as patch on Winavr releases, this was not applied to GCC.

I have bootstrapped and tested this patch for target i686-pc-linux-gnu 
and c language (make check). There were no regressions.

I have bootstrapped and tested this patch for target avr-unknown-none. 
All c tests were run. There were no regressions and 10 test failures 
were removed.

Is this ok to commit to 4.4 HEAD?


If ok, to what extend should this be backported?  It is marked as
regression at GCC 4.1+



2008-05-15 <hutchinsonandy@aim.com>


    PR target/30243
    * builtins.c (expand_builtin_signbit): Don't take lowpart when
    register is already smaller or equal to required mode.












Index: gcc/builtins.c
===================================================================
--- gcc/builtins.c  (revision 135235)
+++ gcc/builtins.c  (working copy)
@@ -5782,7 +5782,7 @@
      lo = 0;
    }

-      if (imode != rmode)
+      if (GET_MODE_SIZE (imode) > GET_MODE_SIZE (rmode))
    temp = gen_lowpart (rmode, temp);
       temp = expand_binop (rmode, and_optab, temp,
               immed_double_const (lo, hi, rmode),




More information about the Gcc-patches mailing list