User account creation filtered due to spam.

Bug 30243 - [4.1/4.2/4.3/4.4 Regression][avr] signbit() causes an internal compiler error
Summary: [4.1/4.2/4.3/4.4 Regression][avr] signbit() causes an internal compiler error
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.1
: P5 normal
Target Milestone: 4.3.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-18 04:37 UTC by Dmitry K.
Modified: 2008-06-04 22:05 UTC (History)
4 users (show)

See Also:
Host:
Target: avr
Build:
Known to work: 3.3.5 3.4.4
Known to fail: 4.1.1 4.1.2 4.2.0
Last reconfirmed: 2007-05-03 17:06:24


Attachments
Patch by Anatoly Sokolov (233 bytes, patch)
2007-10-07 19:46 UTC, Eric Weddington
Details | Diff
New patch (254 bytes, patch)
2008-02-20 20:34 UTC, Eric Weddington
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry K. 2006-12-18 04:37:07 UTC
avr-gcc (GCC) 4.1.1
Compilation of next program (-W -Wall -Os -S):

    extern int signbit (double);
    int foo (double x)
    {
        return signbit (x);
    }

causes an compilation abort with message:
    internal compiler error: in gen_lowpart_general, at rtlhooks.c:51

Older versions are work:
	3.3.5, 3.4.4  - call of external signbit() function
	4.0.2            - inline-code
Comment 1 Eric Weddington 2007-05-03 17:06:24 UTC
Confirmed. Also fails for 4.1.2.
Comment 2 Eric Weddington 2007-05-30 18:09:27 UTC
Fails with 4.3-20070525, and with 4.2.0, with same error, but line 54 in rtlhooks.c.
Comment 3 Eric Weddington 2007-10-07 19:46:54 UTC
Created attachment 14316 [details]
Patch by Anatoly Sokolov

Proposed patch by Anatoly Sokolov.
Comment 4 Eric Weddington 2007-10-07 19:48:25 UTC
Changing target milestone to 4.2.3. Hopefully the attached patch will be committed by then.
Comment 5 Andrew Pinski 2007-10-07 19:51:14 UTC
I think this patch is incorrect (there is no specific ordering of modes as far as I know.  I think it should be using GET_MODE_SIZE instead.
Comment 6 Joseph S. Myers 2008-02-01 16:53:42 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 7 Eric Weddington 2008-02-20 20:34:05 UTC
Created attachment 15187 [details]
New patch

New patch using GET_MODE_SIZE as recommended.
Comment 8 Andy Hutchinson 2008-03-17 23:10:47 UTC
Fails 4.3 on recently added testcase for same bug.

/cygdrive/e/gcc/gcc/testsuite/gcc.c-torture/execute/pr35456.c:17: internal compiler error: in gen_lowpart_general, at rtlhooks.c:53
Please submit a full bug report

Comment 9 Joseph S. Myers 2008-05-19 20:23:00 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 10 Andy Hutchinson 2008-06-04 22:00:40 UTC
Subject: Bug 30243

Author: hutchinsonandy
Date: Wed Jun  4 21:59:54 2008
New Revision: 136376

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136376
Log:
PR target/30243
* builtins.c (expand_builtin_signbit): Don't take lowpart when register is already smaller or equal to required mode. 

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c

Comment 11 Andy Hutchinson 2008-06-04 22:05:46 UTC
Fixed 4.4
Back port to 4.3.2 when its open.
Comment 12 Andy Hutchinson 2008-06-07 15:49:07 UTC
Subject: Bug 30243

Author: hutchinsonandy
Date: Sat Jun  7 15:48:25 2008
New Revision: 136531

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136531
Log:
Backports from 4.4
PR target/27386
* config/avr/avr.h: (PUSH_ROUNDING): Remove.
	
PR target/30243
* builtins.c (expand_builtin_signbit): Don't take lowpart when
register is already smaller or equal to required mode. 	

PR target/34932
* config/avr/avr.md (*addhi3_zero_extend2): Remove.
	
* config/avr/avr.h (MAX_OFILE_ALIGNMENT): Define.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/builtins.c
    branches/gcc-4_3-branch/gcc/config/avr/avr.h
    branches/gcc-4_3-branch/gcc/config/avr/avr.md