[Bug c/42483] AVR fails all whopr/lto tests

2010-01-11 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2010-01-11 23:21 
---
Due to target defining linker name.

Fixed 4.5 HEAD

Author: hutchinsonandy
Date: Mon Jan 11 23:12:14 2010
New Revision: 155819

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155819
Log:
2010-01-11  Andy Hutchinson  hutchinsona...@gcc.gnu.org

* config/avr/avr.h (LINKER_NAME): Remove. 

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.h


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug target/41885] AVR Rotate patterns do not correctly consider overlap.

2010-01-08 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2010-01-08 23:02 
---
Subject: Bug 41885

Author: hutchinsonandy
Date: Fri Jan  8 23:01:45 2010
New Revision: 155746

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155746
Log:
2010-01-08  Andy Hutchinson  hutchinsona...@gcc.gnu.org

  PR target/41885
  * avr.md (rotlqi3): Add CONST_INT_P check.
  (rotlhi3): Delete.
  (rotlhi3_8): Delete.
  (rotlsi3): Delete.
  (rotlsi3_8): Delete.
  (rotlsi3_16): Delete.
  (rotlsi3_24): Delete.
  (rotlmode3): New.
  (*rotwmode3): New.
  (*rotbmode3): New.
  *avr.c (avr_rotate_bytes): New function.
  *avr-proto.h (avr_rotate_bytes): New function. 

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr-protos.h
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md


-- 


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



[Bug middle-end/19154] miss-optimization of (x pow2C) avr conditionals returning bool equivalent values

2009-12-30 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #9 from hutchinsonandy at gcc dot gnu dot org  2009-12-30 16:14 
---
Fixed on 4.5  - or at least significantly better enough to warrant closure.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug target/29560] [avr] Poor optimization for byte shifts

2009-12-30 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-12-31 03:16 
---
The same occurs in 4.5

I think the bug  is invalid

The expression 1 pin will be promoted. This produces a defined result if
pin7 and 15
The expression can not then be lower to 8 bit shift - since a shift by 7 is
undefined.

If you use pin 7, the shift is indeed 8 bit shift. Though it still loads a int
(HIMODE) value of 1 that should have been reduced to QIMODE.

setpinx:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
.L__stack_usage = 0
mov r25,r24
andi r25,lo8(7)
ldi r18,lo8(1)
ldi r19,hi8(1)
mov r24,r18
rjmp 2f
1:  lsl r24
2:  dec r25
brpl 1b
cpi r22,lo8(1)
brne .L7
in r25,53-0x20
or r25,r24
out 53-0x20,r25
ret
.L7:
in r25,53-0x20
com r24
and r24,r25
out 53-0x20,r24
ret


-- 


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



[Bug testsuite/38036] [4.4/4.5 Regression][AVR] FAIL: gcc.c-torture/execute/pr37573.c execution

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 14:46 
---
Fixed already Rev 142978 (29th December 2008)


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug target/35013] Incomplete check in RTL for pm() annotation

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 19:54 
---
Subject: Bug 35013

Author: hutchinsonandy
Date: Thu Dec 24 19:53:57 2009
New Revision: 155459

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155459
Log:
2009-12-24  Andy Hutchinson  hutchinsona...@gcc.gnu.org

PR target/35013, 27192
* config/avr/avr.c (print_operand_address): Print correct program
memory address.
Add warning for large device offset addresses.
(avr_assemble_integer): Ditto.
(print_operand): Add warnings for incorrect addressing.
(out_movqi_r_mr): Tag assembler with new address codes.
(out_movhi_r_mr): Ditto.
(out_movsi_r_mr): Ditto.
(out_movqi_mr_r): Ditto.
(out_movhi_mr_r): Ditto.
(out_movsi_mr_r): Ditto.
* config/avr/predicates.md (text_segment_operand): New predicate.
* config/avr/avr.md (jump): Tag assembler with new address codes.
(call_insn): Ditto.
(call_value_insn): Ditto.
(*tablejump_lib): Ditto.
(*cbi): Ditto.
(*sbi): Ditto.
(indirect_jump): New define_expand.
(jcindirect_jump): New pattern for constant expression jump.
(njcindirect_jump): Renamed old indirect_jump.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md
trunk/gcc/config/avr/predicates.md


-- 


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



[Bug target/35013] Incomplete check in RTL for pm() annotation

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 19:58 
---
Fixed 4.5


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug target/27192] call through function pointer goes to wrong address

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #7 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 20:01 
---
Fixed 4.5


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug target/42457] [4.5 Regression] AVR fails to build with other than C family languages

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 20:32 
---
Subject: Bug 42457

Author: hutchinsonandy
Date: Thu Dec 24 20:32:38 2009
New Revision: 155460

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155460
Log:
2009-12-24  Andy Hutchinson  hutchinsona...@gcc.gnu.org

PR target/42457
* config/avr/avr.c (avr_extra_arch_macro): Remove static.
(avr_cpu_cpp_builtins): Remove.
* config/avr/avr.h (avr_extra_arch_macro): Add prototype.
* config/avr/avr-c.c: New File.
(avr_cpu_cpp_builtins) : Add.
* config/avr/t-avr: Add make information for avr-c.
* config.gcc (avr-*-*): Include avr-c.o as c and cpp object. 

Added:
trunk/gcc/config/avr/avr-c.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config.gcc
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.h
trunk/gcc/config/avr/t-avr


-- 


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



[Bug target/42457] [4.5 Regression] AVR fails to build with other than C family languages

2009-12-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2009-12-24 20:33 
---
Fixed 4.5


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug c/42483] New: AVR fails all whopr/lto tests

2009-12-23 Thread hutchinsonandy at gcc dot gnu dot org
When LTO is enabled AVR fails all whopr/lto tests:

Testsuite fails all lto/whopr tests:

Example:


Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
 -w  -O2 -flto  -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES 
-DSIGNAL_SUPPRESS -mmcu=atmega128 
/home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf
-lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80  -lm   -o
/media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6(timeout = 300)
spawn /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
-w -O2 -flto -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES
-DSIGNAL_SUPPRESS -mmcu=atmega128
/home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf
-lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80 -lm -o
/media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6
/home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be
used without -shared
compiler exited with status 1
output is:
/home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be
used without -shared

FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -flto 


Note LTO was built using patch from

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


-- 
   Summary: AVR fails all whopr/lto tests
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-*-*


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



[Bug target/42457] [4.5 Regression] AVR fails to build with other than C family languages

2009-12-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-12-22 21:18 
---
Created an attachment (id=19375)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19375action=view)
PATCH to add avr-c.c

Here is patch that I believe moves out the C related stuff to avr-c.

builtin_define_std and cpp_define are undeclared - since they have no
prototypes - which is pretty ugly.

Compiler now builds without disabling LTO - BUT I now have LTO/WHPR problems
with LD that is possibly a different bug.

I would like opinion on this before concluding the problem is fixed or indeed
solution is getting closer.


-- 


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



[Bug target/42457] [4.5 Regression] AVR fails to build with other than C family languages

2009-12-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-12-22 21:20 
---
Testsuite fails all lto/whopr tests:

Example:


Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
 -w  -O2 -flto  -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES 
-DSIGNAL_SUPPRESS -mmcu=atmega128 
/home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf
-lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80  -lm   -o
/media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6(timeout = 300)
spawn /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
-w -O2 -flto -fno-builtin-abs -DSTACK_SIZE=2048 -DNO_TRAMPOLINES
-DSIGNAL_SUPPRESS -mmcu=atmega128
/home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf
-lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80 -lm -o
/media/verbatim/gcchead/obj-dir/gcc/testsuite/gcc/abs-1.x6
/home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be
used without -shared
compiler exited with status 1
output is:
/home/andy/local/avr/lib/gcc/avr/4.5.0/../../../../avr/bin/ld: -f may not be
used without -shared

FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -flto 


-- 


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



[Bug testsuite/36903] Generic vectorizarion test failures

2009-12-21 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-12-22 00:01 
---
Subject: Bug 36903

Author: hutchinsonandy
Date: Tue Dec 22 00:00:50 2009
New Revision: 155382

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155382
Log:
2009-12-21  Andy Hutchinson  hutchinsona...@gcc.gnu.org

PR testsuite/36903
* gcc.dg/tree-ssa/gen-vect-11.c : Disable for avr target. It will not
vectorize.
* gcc.dg/tree-ssa/gen-vect-11a.c: Ditto.
* gcc.dg/tree-ssa/gen-vect-2.c: Ditto.
* gcc.dg/tree-ssa/gen-vect-25.c: Ditto.
* gcc.dg/tree-ssa/gen-vect-26.c: Ditto.
* gcc.dg/tree-ssa/gen-vect-28.c: Ditto.
* gcc.dg/tree-ssa/gen-vect-32.c: Ditto.
* gcc.dg/tree-ssa/pr23455.c: Test for 4 eliminations on avr target.
* gcc.dg/tree-ssa/ssa-fre-26.c: XFAIL test for avr.
* gcc.dg/tree-ssa/vrp47.c: Skip test for avr target due to low branch
cost.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c


-- 


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



[Bug testsuite/36903] Generic vectorizarion test failures

2009-12-21 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-12-22 00:16 
---
Fixed 4.5. AVR wont vectorize with word size of 1 byte!


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug c/42457] New: AVR fails to build unless LTO is disabled

2009-12-21 Thread hutchinsonandy at gcc dot gnu dot org
AVR will fail to build with (default) LTO enabled.

LTO becomes enabled when a working libelf implementation is found.

Mike Stein brought this to my attention and I have been able to replicate it
now I have loaded libelf.

The undefined symbol `builtin_define_std' is defined in c-cppbuiltin.c. It
would appear this is not linked for some of lto compilations - yet target avr.c
is.

The root cause seems to be that avr target uses `builtin_define_std' inside a
staic function `avr_cpu_cpp_builtins' (avr.c) - whereas is used to be used
inside a macro (avr.h). On most (all?) other targets it is used inside a macro
When the macro is not used, there is no definition needed and no link error.

A relevant change on avr target was made 149519

2009-07-11  Anatoly Sokolov  ae...@post.ru

* config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Redefine.
(avr_extra_arch_macro) Remove declatation.
* config/avr/avr.c (avr_cpu_cpp_builtins): New function.
(avr_extra_arch_macro) Declare as static.
* config/avr/avr-protos.h (avr_cpu_cpp_builtins): Dclare.


Using --disable-lto switch for configure allows build to complete.


-- 
   Summary: AVR fails to build unless  LTO is disabled
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/42457] AVR fails to build unless LTO is disabled

2009-12-21 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-12-22 03:20 
---
Created an attachment (id=19366)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19366action=view)
Make log file


-- 


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



[Bug rtl-optimization/23726] Missed optimizations for divmod

2009-12-13 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #9 from hutchinsonandy at gcc dot gnu dot org  2009-12-13 21:03 
---
Subject: Bug 23726

Author: hutchinsonandy
Date: Sun Dec 13 21:03:41 2009
New Revision: 155195

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155195
Log:
PR target/23726
* config/avr/predicates.md (pseudo_register_operand): New predicate for
pseudos.
* config/avr/avr.md (divmodqi4): Replace with define_insn_and_split to allow
div/mod optimization.
(udivmodqi4): Ditto.
(divmodhi4): Ditto.
(udivmodhi4): Ditto.
(divmodsi4): Ditto.
(udivmodsi4): Ditto. 

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.md
trunk/gcc/config/avr/predicates.md


-- 


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



[Bug rtl-optimization/23726] Missed optimizations for divmod

2009-12-13 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #10 from hutchinsonandy at gcc dot gnu dot org  2009-12-13 
21:05 ---
Fixed 4.5


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug middle-end/42303] New: Shift left as wide as mode is expanded into RTL as shift

2009-12-05 Thread hutchinsonandy at gcc dot gnu dot org
Shift LEFT by the full length of integer is carried through to RTL as shift - 
rather than being ZERO.

This hidden zero prevents further optimization. For example x = a + (B16)
should be reduced to x = a. Instead we get x = 0 | a;
This can also be seen in rotate expressions.



int16_t shiftzero(uint16_t x,uint16_t y)
{
return x + (y16);
}




shiftzero (uint16_tD. xD., uint16_tD. yD.)
{
  uint16_tD. D.;
  uint16_tD. D.;
  int16_tD. D.;

  # BLOCK 2 freq:1
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  D._2 = yD._1(D)  16;
  D._4 = D._2 + xD._3(D);
  D._5 = (int16_tD.) D._4;
  return D._5;
  # SUCC: EXIT [100.0%] 

}






/* NOTE Same on rotate - since expander is uses shift */
int16_t rotatezero(uint16_t x,uint16_t y)
{
return ROTATE (x,16);
}

rotatezero (uint16_tD. xD., uint16_tD. yD.)
{
  uint16_tD. D.;
  uint16_tD. D.;
  int16_tD. D.;

  # BLOCK 2 freq:1
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  D._2 = xD._1(D)  16;
  D._3 = D._2 | xD._1(D);
  D._4 = (int16_tD.) D._3;
  return D._4;
  # SUCC: EXIT [100.0%] 

}


-- 
   Summary: Shift left as wide as mode is expanded into RTL as shift
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug target/42210] avr: optimizing assignment to a bit field

2009-11-29 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-11-29 14:35 
---
Same on 4.5 Head.

The backend patterns match against MEM AND singlebit. 
Combine never considers this.

Incoming RTL and Combine pass dump file extract:

;; Pred edge  ENTRY [100.0%]  (fallthru)
(note 4 0 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 2 4 3 2 rot.c:25 (set (reg/v:QI 41 [ flag ])
(reg:QI 24 r24 [ flag ])) 4 {*movqi} (expr_list:REG_DEAD (reg:QI 24 r24
[ flag ])
(nil)))

(note 3 2 7 2 NOTE_INSN_FUNCTION_BEG)

(insn 7 3 8 2 rot.c:26 (set (reg:QI 43)
(and:QI (reg/v:QI 41 [ flag ])
(const_int 1 [0x1]))) 43 {andqi3} (expr_list:REG_DEAD (reg/v:QI 41
[ flag ])
(nil)))

(insn 8 7 9 2 rot.c:26 (set (reg:QI 44)
(ashift:QI (reg:QI 43)
(const_int 6 [0x6]))) 59 {*ashlqi3} (expr_list:REG_DEAD (reg:QI 43)
(nil)))

(insn 9 8 10 2 rot.c:26 (set (reg:QI 45)
(mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])) 4 {*movqi} (nil))

(insn 10 9 11 2 rot.c:26 (set (reg:QI 46)
(and:QI (reg:QI 45)
(const_int -65 [0xffbf]))) 43 {andqi3} (expr_list:REG_DEAD
(reg:QI 45)
(nil)))

(insn 11 10 12 2 rot.c:26 (set (reg:QI 47)
(ior:QI (reg:QI 46)
(reg:QI 44))) 46 {iorqi3} (expr_list:REG_DEAD (reg:QI 46)
(expr_list:REG_DEAD (reg:QI 44)
(nil

(insn 12 11 0 2 rot.c:26 (set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(reg:QI 47)) 4 {*movqi} (expr_list:REG_DEAD (reg:QI 47)
(nil)))
;; End of basic block 2 - ( 1)




Trying 2 - 7:
Successfully matched this instruction:
(set (reg:QI 43)
(and:QI (reg:QI 24 r24 [ flag ])
(const_int 1 [0x1])))
deferring deletion of insn with uid = 2.
modifying insn i3 7 r43:QI=r24:QI0x1
  REG_DEAD: r24:QI
deferring rescan insn with uid = 7.

Trying 7 - 8:
Failed to match this instruction:
(set (reg:QI 44)
(and:QI (ashift:QI (reg:QI 24 r24 [ flag ])
(const_int 6 [0x6]))
(const_int 64 [0x40])))

Trying 9 - 10:
Failed to match this instruction:
(set (reg:QI 46)
(and:QI (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(const_int -65 [0xffbf])))

Trying 8 - 11:
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (ashift:QI (reg:QI 43)
(const_int 6 [0x6]))
(reg:QI 46)))

Trying 10 - 11:
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (and:QI (reg:QI 45)
(const_int -65 [0xffbf]))
(reg:QI 44)))

Trying 7, 8 - 11:
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (and:QI (ashift:QI (reg:QI 24 r24 [ flag ])
(const_int 6 [0x6]))
(const_int 64 [0x40]))
(reg:QI 46)))
Failed to match this instruction:
(set (reg:QI 44)
(and:QI (ashift:QI (reg:QI 24 r24 [ flag ])
(const_int 6 [0x6]))
(const_int 64 [0x40])))

Trying 9, 10 - 11:
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (and:QI (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(const_int -65 [0xffbf]))
(reg:QI 44)))
Failed to match this instruction:
(set (reg:QI 46)
(and:QI (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(const_int -65 [0xffbf])))

Trying 10, 8 - 11:
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (and:QI (reg:QI 45)
(const_int -65 [0xffbf]))
(ashift:QI (reg:QI 43)
(const_int 6 [0x6]
Successfully matched this instruction:
(set (reg:QI 46)
(ashift:QI (reg:QI 43)
(const_int 6 [0x6])))
Failed to match this instruction:
(set (reg:QI 47)
(ior:QI (and:QI (reg:QI 45)
(const_int -65 [0xffbf]))
(reg:QI 46)))

Trying 11 - 12:
Failed to match this instruction:
(set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(ior:QI (reg:QI 46)
(reg:QI 44)))

Trying 8, 11 - 12:
Failed to match this instruction:
(set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(ior:QI (ashift:QI (reg:QI 43)
(const_int 6 [0x6]))
(reg:QI 46)))
Successfully matched this instruction:
(set (reg:QI 47)
(ashift:QI (reg:QI 43)
(const_int 6 [0x6])))
Failed to match this instruction:
(set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(ior:QI (reg:QI 47)
(reg:QI 46)))

Trying 10, 11 - 12:
Failed to match this instruction:
(set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(ior:QI (and:QI (reg:QI 45)
(const_int -65 [0xffbf]))
(reg:QI 44)))
Successfully matched this instruction:
(set (reg:QI 47)
(and:QI (reg:QI 45)
(const_int -65 [0xffbf])))
Failed to match this instruction:
(set (mem/s/j:QI (const_int 35 [0x23]) [0 S1 A8])
(ior:QI (reg:QI 47)
(reg:QI 44)))





__SREG__ = 0x3f
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__tmp_reg__ = 0
__zero_reg__ = 1
.global __do_copy_data
.global __do_clear_bss
.text
.global set_flag_good
.type   set_flag_good, @function
set_flag_good:
/* prologue

[Bug c/42204] New: update_eliminables should be called in reload after something changes

2009-11-27 Thread hutchinsonandy at gcc dot gnu dot org
This bug was previously mentioned in email from Denis. I have confirmed this on
4.5 (after long but educational tour of reload)

http://gcc.gnu.org/ml/gcc/2006-03/msg00783.html

When stacks slots increase from zero in reload() (in my case due to
setup_save_areas() ) the register elimination conditions can change. For
example the AVR port has:

get_frame_size ()  0 

as part of frame_pointer_required_p thus FP-SP elimination can change.

New slots do restart the spill and reload loop :

  /* If we allocated another stack slot, redo elimination bookkeeping.  */
  if (starting_frame_size != get_frame_size ())
continue;

BUT update_eliminables is never called before calculate_needs_all_insns(), so
the wrong reloads are calculated (in my case marking the FP to be spilled in
the just added caller save insn !)

As a consequence, a spill and reload failure occurs.

The solution would seem to be to add update_eliminables before
calculate_needs_all_insns (global);


-- 
   Summary: update_eliminables should be called in reload after
something changes
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug target/41077] [avr] excessive prologue/epilogue for interrupt handler

2009-11-26 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-11-26 17:12 
---
R1 and R0 are used at assembler level outside of compiler scope.
R1 is always expected to contain as a zero value - to avoid using a register to
load this common value. R1 maybe used in assembler for other purposes - but
must be restored to zero.

R0 is used as a temporary - to get around awkward situation created by compiler
like a = *a;

Thus any ISR will always save these values - and clear r1. Gcc cannot see
either r1 or r0 or otherwise track usage.


While we may debate the merits of this approach. It has been this way from day
one and will not change.

:-(


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WONTFIX


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



[Bug target/21080] Excecution test failure for avr for pr17377 test case.

2009-11-26 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2009-11-26 17:20 
---
Fixed on 4.5

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


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug target/37081] [avr] FAIL: gcc.dg/pr36998.c

2009-11-26 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-11-26 17:25 
---
Author: hutchinsonandy
Date: Mon Nov 23 21:38:32 2009
New Revision: 154467

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154467
Log:
* gcc.dg/pr36998.c: Frame pointer required for avr target.
* gcc.dg/debug/pr41264-1.c: Use long if int size 16bit or smaller.
* gcc.dg/pr39226.c: Use smaller bitfield if int size is 16bit.
* gcc.dg/pr41340.c: Test requires long pointer target.
* gcc.dg/profile-generate-3.c: Test requires profiling support.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/debug/pr41264-1.c
trunk/gcc/testsuite/gcc.dg/pr36998.c
trunk/gcc/testsuite/gcc.dg/pr39226.c
trunk/gcc/testsuite/gcc.dg/pr41340.c
trunk/gcc/testsuite/gcc.dg/profile-generate-3.c


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug testsuite/38202] [avr] FAIL: gcc.dg/torture/pr37868.c

2009-11-26 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-11-26 17:29 
---
Fixed 4.5

Author: hutchinsonandy
Date: Mon Nov 23 22:21:21 2009
New Revision: 154474

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154474
Log:
* gcc.dg/torture/pr37868.c: Use smaller bitfield for 16bit int targets.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/torture/pr37868.c


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug c/36470] sizeof UTF-32 is 2 on AVR

2009-11-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-11-23 22:10 
---
Subject: Bug 36470

Author: hutchinsonandy
Date: Mon Nov 23 22:10:18 2009
New Revision: 154471

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154471
Log:
PR testsuite/36470
* gcc.dg/utf-cvt.c: Skip int test for 16bit int targets.
Enable short test for avr target.
* gcc.dg/utf32-1.c: Enable test for avr and m32 targets.
* gcc.dg/utf32-2.c: Ditto.
* gcc.dg/utf32-3.c: Ditto.
* gcc.dg/utf32-4.c: Enable test for non-32bit targets.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/utf-cvt.c
trunk/gcc/testsuite/gcc.dg/utf32-1.c
trunk/gcc/testsuite/gcc.dg/utf32-2.c
trunk/gcc/testsuite/gcc.dg/utf32-3.c
trunk/gcc/testsuite/gcc.dg/utf32-4.c


-- 


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



[Bug c/42146] New: ICE in tree_low_cst

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org
The test trunk/gcc/testsuite/gcc.dg/large-size-array-2.c causes ICE on AVR
target.

/* PR c/25309 */
/* { dg-do compile } */
/* { dg-options -O2 } */
static char * name[] = {
[0x8000]  = bar
  };
/* { dg-error too large  { target { { ! lp64 }  { ! llp64 } } }  6 } */


llp645503.c:2:6: error: size of array 'dummy' is negative

Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/large-size-array-2.c   -O2
-DSTACK_SIZE=2048 -DNO_TRAMPOLINES -S  -DSIGNAL_SUPPRESS -mmcu=atmega128   -o
large-size-array-2.s(timeout = 300)
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/large-size-array-2.c:6:3:
internal compiler error: in tree_low_cst, at tree.c:6199


-- 
   Summary: ICE in tree_low_cst
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/42147] New: ICE: verify_stmts failed

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org
Test trunk/gcc/testsuite/gcc.dg/pr34668-1.c fails with ICE for AVR target.

PR34668-1.c:

/* PR c/34668 */
/* { dg-do compile } */
/* { dg-options --combine -O2 } */
/* { dg-additional-sources pr34668-2.c } */

struct optab { unsigned code; };
extern struct optab optab_table[1];

void
init_optab (struct optab *op)
{
  op-code = 0xdead;
}

void
set_conv_libfunc (void)
{
  init_optab (optab_table[0]);
}
-
PR34668-2.c:

/* PR c/34668 */
/* { dg-do compile } */

struct optab { unsigned code; };
extern struct optab optab_table[1];

---

Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr34668-1.c   --combine -O2
-DSTACK_SIZE=2048 -DNO_TRAMPOLINES 
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr34668-2.c -S 
-DSIGNAL_SUPPRESS -mmcu=atmega128   -o pr34668-1.s(timeout = 300)
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr34668-2.c: In function
'set_conv_libfunc':
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr34668-2.c:5:15: error:
type mismatch in array reference
struct optab

struct optab

# .MEM_3 = VDEF .MEM_1(D)
optab_table[0].code = 57005;

/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr34668-2.c:5:15: internal
compiler error: verify_stmts failed
Please submit a full bug report,


-- 
   Summary: ICE:  verify_stmts failed
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/42149] New: ICE:verify_gimple failed for avr target

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org
Test trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c (and friends) fails with ICE
on AVR target.

Note there is existing open bug PR37165 - but the failure noted was not ICE.


Executing on host: /media/verbatim/gcchead/obj-dir/gcc/xgcc
-B/media/verbatim/gcchead/obj-dir/gcc/
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c   -O3
-fipa-matrix-reorg -fdump-ipa-matrix-reorg -fwhole-program -combine
-DSTACK_SIZE=2048 -DNO_TRAMPOLINES  -DSIGNAL_SUPPRESS -mmcu=atmega128 
/home/andy/winavrfiles/avrtest/dejagnuboards/exit.c -Wl,-u,vfprintf
-lprintf_flt -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80  -lm   -o
./matrix-1.exe(timeout = 300)
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c: In
function 'mem_init':
/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c:52:1:
error: type mismatch in array reference
struct __file *

struct __file *

D.3778 = __iob[2];

/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c:52:1:
error: type mismatch in array reference
struct __file *

struct __file *

D.3778 = __iob[2];

/media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/matrix/matrix-1.c:52:1:
internal compiler error: verify_gimple failed
Please submit a full bug report,


-- 
   Summary: ICE:verify_gimple failed for avr target
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug target/36055] Missed optimsation of QI register loads

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-11-22 18:57 
---
Fixed on 4.5

Revision 152958


2009-10-17  Andy Hutchinson  hutchinsona...@aim.com
* config/avr.md (*movqi): Add zero as equally preferable constraint as general
register.
(*movhi): Ditto. 


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug middle-end/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #11 from hutchinsonandy at gcc dot gnu dot org  2009-11-22 
18:59 ---
Fixed.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug c/42114] c99-stdint test fails for ptrdiff test

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-11-22 19:02 
---
Fixed 4.5


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug middle-end/41738] optabs expands rotate using wrong mode

2009-11-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-11-22 19:04 
---
Fixed 4.5
Back port needed.


-- 


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



[Bug c/36470] sizeof UTF-32 is 2 on AVR

2009-11-21 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-11-21 15:06 
---
Test and now passes for avr and m32 targets.

gcc.dg/utf32-1.c 
gcc.dg/utf32-2.c 
gcc.dg/utf32-3.c 

I will remove XFAIL in cleanup patch.


-- 


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



[Bug c/42114] c99-stdint test fails for ptrdiff test

2009-11-20 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-11-21 01:35 
---
Subject: Bug 42114

Author: hutchinsonandy
Date: Sat Nov 21 01:34:51 2009
New Revision: 154392

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154392
Log:
PR Testsuite/42114
* gcc-dg/c99-stdint-1.c: Condition test for target without signal.h. XFAIL
ptrdiff range test for avr.
* gcc-dg/c99-stdint-2.c: XFAIL for avr target.
* gcc-dg/c99-stdint-5.c: Condition test for target without signal.h.
* gcc-dg/c99-stdint-6.c: Ditto.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/c99-stdint-1.c
trunk/gcc/testsuite/gcc.dg/c99-stdint-2.c
trunk/gcc/testsuite/gcc.dg/c99-stdint-5.c
trunk/gcc/testsuite/gcc.dg/c99-stdint-6.c


-- 


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



[Bug c/42114] New: c99-stdint test fails for ptrdiff test

2009-11-19 Thread hutchinsonandy at gcc dot gnu dot org
Test gcc.dg/c99-stdint-1.c checks for range of__PTRDIFF_TYPE__ and fails for
avr target.

test_misc_limits (void)
{
  CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L,
65535L);


On AVR pointers and integers are 16bit. 

INTPTR_MIN =-32768
INTPTR_MAX = 32767
UINTPTR_MAX = 65535U

__PTRDIFF_MAX__ is set by gcc at 32767 and so stdint.h gives PTRDIFF_MAX 32767
and PTRDIFF_MIN -32768

I am not sure why minimum range limits are applied in this test or if
test/gcc/target is wrong.


-- 
   Summary: c99-stdint test fails for ptrdiff test
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/42114] c99-stdint test fails for ptrdiff test

2009-11-19 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-11-20 02:07 
---
I found c99 limit now which explains it. 

I was tempted to make PTRDIFF_TYPE signed 32 bits to solve c99 compliance -
however that completely  useless as  we cannot declare array exceeding  32767
bytes anyway (http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00023.html), despite
it being physically possible and with SIZE_TYPE  unsigned 16 bits.

Skipping the paricular test would seem appropriate - keeping the others which
are useful.

So should I skip ptrdiff limit test based on pointers being 32 bits? Perhaps
ints  32 bits Or do I use stdint definition of INTPTR_MAX 65535 ?


-- 


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



[Bug target/21078] Testsuite reports excecution failure for gcc.c-torture/execute/20010122.c for some optimization levels

2009-11-14 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-11-15 04:10 
---
Subject: Bug 21078

Author: hutchinsonandy
Date: Sun Nov 15 04:10:20 2009
New Revision: 154188

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154188
Log:
PR target/21078, 21080
* config/avr/avr.c (avr_return_addr_rtx): New function for
builtin_return_address.
(expand_prologue): Calculate stack usage.
(avr_asm_function_end_prologue): Output stack size and offset label.
* config/avr/avr.h (RETURN_ADDR_RTX): Replace.
(machine_function): Add stack_usage.
* config/avr/avr-protos.h (avr_return_addr_rtx): New function.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr-protos.h
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.h


-- 


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



[Bug middle-end/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-11-11 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #10 from hutchinsonandy at gcc dot gnu dot org  2009-11-12 
02:36 ---
Subject: Bug 41440

Author: hutchinsonandy
Date: Thu Nov 12 02:35:49 2009
New Revision: 154112

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154112
Log:
PR middle-end/41440
* cfgexpand.c (expand_gimple_basic_block): Append NOP to a fallthru,
single successor block, ending with jump created by RTL expander.

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


-- 


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



[Bug target/41894] wrong code with -fno-split-wide-types

2009-11-01 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-11-01 17:24 
---
The problem is still present on 4.3.5 head
I cannot reproduce on 4.5 

It looks like reload issue with SUBREG. 

Instruction 18 gets reloaded. The output reload is HImode. I will post dump
files but here is extract that appears to highlight problem.

From lreg dump file:

;; Pred edge  3 [50.0%]  (fallthru)
(note 16 15 17 4 [bb 4] NOTE_INSN_BASIC_BLOCK)

(note 17 16 18 4 NOTE_INSN_DELETED)

(insn 18 17 54 4 pr41894.c:29 (set (subreg:QI (reg/v:HI 43 [ tmp ]) 0)
(plus:QI (reg:QI 42 [ D.1188 ])
(const_int -1 [0x]))) 15 {addqi3} (expr_list:REG_DEAD
(reg:QI 42 [ D.1188 ])
(nil)))

(jump_insn 54 18 55 4 (set (pc)
(label_ref 26)) 101 {jump} (nil))
;; End of basic block 4 - ( 6)
;; lr  out   28 [r28] 32 [__SP_L__] 34 [argL] 43
;; live  out 28 [r28] 32 [__SP_L__] 34 [argL] 43


from greg dump file:

Spilling for insn 18.
Using reg 18 for reload 0
Spilling for insn 18.
Using reg 18 for reload 0

Reloads for insn # 18
Reload 0: reload_in (QI) = (reg:QI 24 r24 [orig:42 D.1188 ] [42])
reload_out (HI) = (reg/v:HI 28 r28 [orig:43 tmp ] [43])
LD_REGS, RELOAD_OTHER (opnum = 0)
reload_in_reg: (reg:QI 24 r24 [orig:42 D.1188 ] [42])
reload_out_reg: (reg/v:HI 28 r28 [orig:43 tmp ] [43])
reload_reg_rtx: (reg:HI 18 r18)
deleting insn with uid = 2.
;; Register dispositions:
42 in 24  43 in 28  44 in 24  

;; Hard regs used:  18 19 24 25 28 29 32


Giving


(insn 57 17 18 4 pr41894.c:29 (set (reg:QI 18 r18)
(reg:QI 24 r24 [orig:42 D.1188 ] [42])) 4 {*movqi} (nil))

(insn 18 57 58 4 pr41894.c:29 (set (reg:QI 18 r18)
(plus:QI (reg:QI 18 r18)
(const_int -1 [0x]))) 15 {addqi3} (nil))

(insn 58 18 54 4 pr41894.c:29 (set (reg/v:HI 28 r28 [orig:43 tmp ] [43])
(reg:HI 18 r18)) 8 {*movhi} (nil))

(jump_insn 54 58 55 4 (set (pc)


-- 


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



[Bug target/41894] wrong code with -fno-split-wide-types

2009-11-01 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-11-01 17:27 
---
Created an attachment (id=18945)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18945action=view)
dump file


-- 


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



[Bug target/41894] wrong code with -fno-split-wide-types

2009-11-01 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2009-11-01 17:27 
---
Created an attachment (id=18946)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18946action=view)
dump file


-- 


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



[Bug target/41894] wrong code with -fno-split-wide-types

2009-11-01 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #8 from hutchinsonandy at gcc dot gnu dot org  2009-11-02 00:54 
---
The problem seems related to use of R28+r29 - which is also frame pointer.

avr_hard_regno_mode_ok allows R28 in HIMODE but not any other mode. (This hack
was made to avoid reload problem where r29 was used as well as R28 frame
pointer)

It looks like the not ok QI subreg 28/29 of ok HImode r28 is not handled
well. 

The mode restriction is ignored for input reload. (Perhaps because reload
decides to use available frame pointer)

The output reload needed is 16bit HImode but must be accessible as two QImode 
subregs. Somehow the mode of output reload gets mangled so we get movw r28,r18


Originally ~2005 the rejection of other modes by avr_hard_regno_mode_ok for r28
was only applied when reload was in progress and frame_pointer_required.

So I reapplied this condition and the bug was solved. This function does not
need frame pointer so r28 and r29 are indeed freely available.

  /* Otherwise disallow all regno/mode combinations that span r28:r29.  */
  if (reload_in_progress  frame_pointer_needed  regno = (REG_Y + 1) 
(regno + GET_MODE_SIZE (mode)) = (REG_Y + 1))
return 0;


This also produces better code!

One concern is that the modes deemed ok or not are now not constant - and
perhaps is the reason why condition was removed.

In Gcc 4.5 the spill is exactly the same but it uses R16/r17 with the correct
output reload subreg - so seems to figure out that r28 is not ok - suggesting
problem is fixed.


This may take a while to resolve, with some further research and testing.


-- 


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



[Bug target/21080] Excecution test failure for avr for pr17377 test case.

2009-10-31 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-10-31 15:27 
---
*** Bug 21078 has been marked as a duplicate of this bug. ***


-- 
Bug 21080 depends on bug 21078, which changed state.

Bug 21078 Summary: Testsuite reports excecution failure for 
gcc.c-torture/execute/20010122.c for some optimization levels
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21078

   What|Old Value   |New Value

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE

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



[Bug target/21078] Testsuite reports excecution failure for gcc.c-torture/execute/20010122.c for some optimization levels

2009-10-31 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-10-31 15:27 
---


*** This bug has been marked as a duplicate of 21080 ***


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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



[Bug target/21080] Excecution test failure for avr for pr17377 test case.

2009-10-31 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-10-31 17:02 
---
Anatoly,

can we implement this patch to correct __builtin_return_address and thus remove
these old bug reports and associated testsuite failures? It also provides a
means to document stack usage which would seem useful.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||aesok at pautinka dot net


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



[Bug target/41894] wrong code with -fno-split-wide-types

2009-10-31 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-10-31 23:02 
---
Please post entire assembler code.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||hutchinsonandy at gcc dot
   ||gnu dot org


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



[Bug target/41885] New: AVR Rotate patterns do not correctly consider overlap.

2009-10-30 Thread hutchinsonandy at gcc dot gnu dot org
Rotate patterns that split byte sized rotates into moves do not correctly
consider overlap of operands.

This was noted on a similar but different shift bug 

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

and detailed here

http://lists.gnu.org/archive/html/avr-gcc-list/2009-03/msg00158.html

Bug raised to reference separate testcase and fix.


-- 
   Summary: AVR Rotate patterns do not correctly consider overlap.
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i486-linux-gnu
GCC target triplet: avr-*-*


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



[Bug target/41885] AVR Rotate patterns do not correctly consider overlap.

2009-10-30 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-10-31 00:38 
---
Subject: Bug 41885

Author: hutchinsonandy
Date: Sat Oct 31 00:38:10 2009
New Revision: 153773

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153773
Log:
PR target/41885
* gcc.target/avr/torture/pr41885.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/avr/torture/pr41885.c
Modified:
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug middle-end/19154] miss-optimization of (x pow2C) avr conditionals returning bool equivalent values

2009-10-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #7 from hutchinsonandy at gcc dot gnu dot org  2009-10-24 15:36 
---
Subject: Bug 19154

Author: hutchinsonandy
Date: Sat Oct 24 15:36:40 2009
New Revision: 153530

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153530
Log:
PR middle-end/19154
* avr.md (QIDI): Add new mode iterator.
(sbrx_branchmode): Create new zero extract bit, test and jump
patterns for all QI-DI modes combinations.
(sbrx_and_branchmode): Create new and based bit test and jump
patterns for QI-SI modes.
avr.c (avr_out_sbxx_branch): Use only bit number.

Modified:
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md


-- 


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



[Bug middle-end/19154] miss-optimization of (x pow2C) avr conditionals returning bool equivalent values

2009-10-24 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #8 from hutchinsonandy at gcc dot gnu dot org  2009-10-24 15:39 
---
Subject: Bug 19154

Author: hutchinsonandy
Date: Sat Oct 24 15:39:23 2009
New Revision: 153531

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153531
Log:
PR middle-end/19154
* avr.md (QIDI): Add new mode iterator.
(sbrx_branchmode): Create new zero extract bit, test and jump
patterns for all QI-DI modes combinations.
(sbrx_and_branchmode): Create new and based bit test and jump
patterns for QI-SI modes.
avr.c (avr_out_sbxx_branch): Use only bit number.

Modified:
trunk/gcc/ChangeLog


-- 


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



[Bug middle-end/41738] New: optabs expands rotate using wrong mode

2009-10-17 Thread hutchinsonandy at gcc dot gnu dot org
I have been adding rotate capability to AVR port and have come this bug in 
optabs.c: expand_binop()

This occurs during a rotate expansion. For example

target  = op0  rotated by op1

In the particular situation (code extract below) it tries a reverse rotate of
(bits - op1). Where this expression is then expanded into an integer,
a negation or subtraction depending on type of op1 and target.

The expansion of the subtraction is using the mode of the target - it should be
using the mode of op1.
The mode of the rotation  amount need not be the same as the target.

target:DI = Op0:DI rotate op1:HI

In my testcase it is not and I get asserts latter in simplfy_rtx with the
mismatched inner/outer modes.

The negation mode looks equally wrong.

I found this on testcase 20010226-1.c with gcc 4.42 (line 55) - however, it
would appear to be on 4.5 and perhaps earlier versions.

Revision 126370 added this particular code to optabs.c in July 2007



 /* If we were trying to rotate, and that didn't work, try rotating
the other direction before falling back to shifts and bitwise-or.  */
 if (((binoptab == rotl_optab
optab_handler (rotr_optab, mode)-insn_code != CODE_FOR_nothing)
  || (binoptab == rotr_optab
   optab_handler (rotl_optab, mode)-insn_code != CODE_FOR_nothing))
  mclass == MODE_INT)
   {
 optab otheroptab = (binoptab == rotl_optab ? rotr_optab : rotl_optab);
 rtx newop1;
 unsigned int bits = GET_MODE_BITSIZE (mode);

 if (CONST_INT_P (op1))
   newop1 = GEN_INT (bits - INTVAL (op1));
 else if (targetm.shift_truncation_mask (mode) == bits - 1)
   newop1 = negate_rtx (mode, op1);
 else
   newop1 = expand_binop (mode, sub_optab,
  GEN_INT (bits), op1,
  NULL_RTX, unsignedp, OPTAB_DIRECT);


-- 
   Summary: optabs expands rotate using wrong mode
   Product: gcc
   Version: 4.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug middle-end/41738] optabs expands rotate using wrong mode

2009-10-17 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-10-17 22:42 
---
Subject: Bug 41738

Author: hutchinsonandy
Date: Sat Oct 17 22:42:17 2009
New Revision: 152961

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=152961
Log:
2009-10-17  Andy Hutchinson hutchinsona...@gcc.gnu.org
PR middle-end/41738
* optabs.c (expand_binop): Make mode of shift count expression mode of shift
count not target.
Remove indent nit.

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


-- 


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



[Bug middle-end/41738] optabs expands rotate using wrong mode

2009-10-17 Thread hutchinsonandy at gcc dot gnu dot org


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.4.3


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



[Bug middle-end/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-10-01 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #9 from hutchinsonandy at gcc dot gnu dot org  2009-10-02 00:30 
---
Checked earlier version. They all insert on edge before RTL is expanded.
Making this 4.5 regression.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|c   |middle-end
  Known to fail||4.5.0
  Known to work||4.4.2 4.3.2


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-30 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #8 from hutchinsonandy at gcc dot gnu dot org  2009-10-01 01:49 
---
Created an attachment (id=18681)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18681action=view)
Fix

After lengthy and productive correspondence with Michael Matz, we have arrived
at a conclusion.

The patch above is ok but it is preferred to fix the problem at the point of
RTL expansion. A block that ends with a jump created by RTL expander on an
otherwise fallthru edge, is padded with mov(r,r) NOP. Thus
commit_one_edge_insertion() will no longer find and interpret this as a jump to
successor causing the insertion point to be wrong.
The problem breaks cc0 targets during CSE. Non cc0 targets can equally get
erroneous insertion made inside RTL expander loop pattern. These may or may not
break.

Regression tested on Rev15226 (20090927)
Native configuration  i686-pc-linux-gnu with no regression on C tests (G++
still running) 
Also
Target is avr-unknown-none
Host   is i686-pc-linux-gnu
Producing 28 less failure on C testsuite, no regressions.

2009-09-30  Andy Hutchinson hutchinsona...@gcc.gnu.org

PR middle-end/41440
* cfgexpand.c (expand_gimple_basic_block): Append NOP to a fallthru,
single successor block, ending with jump created by RTL expander.



-- 


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-27 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2009-09-27 17:30 
---
Created an attachment (id=18663)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18663action=view)
Patch to cfgrtl.c  commit_one_edge_insertion()

The problem is in cfgrtl.c function commit_one_edge_insertion()

It does copy value for phi nodes to previous edge. If it find jump on edge it 
places copy before it. It assumes that edge is fall thru edge.
For a fall thru edge, the last instruction can be anything - specifically a
jump just created by RTL expander.

The bug has been present since Rev 146817

I have attached patch that correct the problem.


Index: cfgrtl.c
===
--- cfgrtl.c(revision 152217)
+++ cfgrtl.c(working copy)
@@ -1482,8 +1482,9 @@
 happens on the fr30 for example.

 We know this block has a single successor, so we can just emit
-the queued insns before the jump.  */
- if (JUMP_P (BB_END (bb)))
+the queued insns before the jump. Fallthru edges can have
+jumps created by RTL expander, so ignore these.  */
+ if (!(e-flags  EDGE_FALLTHRU)  JUMP_P (BB_END (bb)))
before = BB_END (bb);
  else
{


-- 


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



[Bug debug/41474] [4.5 Regression] 951116-1.c ICEs in mem_loc_descriptor, at dwarf2out.c:11279

2009-09-27 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-09-27 19:15 
---
Same for AVR target. Numerous example (though not same testcase)

/home/andy/gccsvn/gcc/testsuite/gcc.c-torture/compile/pr38123.c:13:1: internal
compiler error: in mem_loc_descriptor, at dwarf2out.c:11292

Was ok on September 12th and has been failing for a last week or so.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||hutchinsonandy at gcc dot
   ||gnu dot org


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2009-09-24 02:15 
---
Created an attachment (id=18641)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18641action=view)
cleanup_cfg dump


-- 


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2009-09-24 02:15 
---
Created an attachment (id=18642)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18642action=view)
ssa dump


-- 


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2009-09-24 02:21 
---
Problem is located in ssa pass. It seems to name initialization of loop index
to something other than the loop index increment and tested in the last for
loop. This deadinitialization is deleted in latter passes  but the damage is
done and the data flow is obviously meesed up.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2009-09-24 03:30 
---
Forget previous post, I misunderstood PHI node. However, I was close

The PHI in block 5 has incoming ZERO constant. With detailed expansion dump
file , it can be seen that this constant value copy is inserted on BB edge 4-5
but the RTL shows it is actually added one instruction before end of block 4.
The edge 4-5 falls through and insertion should be after jump that is last
insn of BB 4 (and the end of memcpy do loop  expansion)

Hopefully, I right this time.


;; Function main (main)


Pass statistics:



CFG Statistics for main

-
Number ofMemory
instances used 
-
Basic blocks  9576b
Edges 8352b
-
Total memory used by CFG data  928b
-

Coalesced label blocks: 0 (Max so far: 0)

main ()
{
  unsigned intD.3 src.29D.2127;
  unsigned intD.3 D.2128;
  unsigned charD.10 D.2124;
  unsigned charD.10 D.2126;
  unsigned intD.3 ivtmp.25D.2120;
  unsigned intD.3 ivtmp.20D.2115;
  unsigned charD.10 dstD.1321[100];
  unsigned charD.10 srcD.1320[100];
  unsigned intD.3 iD.1319;
  unsigned charD.10 D.2091;
  unsigned charD.10 D.2090;

  # BLOCK 2 freq:100
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  ivtmp.20D.2115_23 = (unsigned intD.3) srcD.1320[0];
  ivtmp.25D.2120_26 = (unsigned intD.3) dstD.1321[0];
  src.29D.2127_31 = (unsigned intD.3) srcD.1320;
  D.2128_32 = src.29D.2127_31 + 100;
  # SUCC: 3 [100.0%]  (fallthru,exec)

  # BLOCK 3 freq:9900
  # PRED: 3 [99.0%]  (true,exec) 2 [100.0%]  (fallthru,exec)
  # ivtmp.20D.2115_2 = PHI ivtmp.20D.2115_16(3), ivtmp.20D.2115_23(2)
  # ivtmp.25D.2120_24 = PHI ivtmp.25D.2120_25(3), ivtmp.25D.2120_26(2)
  D.2124_27 = (unsigned charD.10) ivtmp.20D.2115_2;
  D.2126_29 = (unsigned charD.10) ivtmp.20D.2115_23;
  D.2090_30 = D.2124_27 - D.2126_29;
  # .MEMD.2094_12 = VDEF .MEMD.2094_20
  MEM[index: ivtmp.20D.2115_2] = D.2090_30;
  ivtmp.20D.2115_16 = ivtmp.20D.2115_2 + 1;
  # .MEMD.2094_13 = VDEF .MEMD.2094_12
  MEM[index: ivtmp.25D.2120_24] = 0;
  ivtmp.25D.2120_25 = ivtmp.25D.2120_24 + 1;
  if (ivtmp.20D.2115_16 != D.2128_32)
goto bb 3;
  else
goto bb 4;
  # SUCC: 3 [99.0%]  (true,exec) 4 [1.0%]  (false,exec)

  # BLOCK 4 freq:100
  # PRED: 3 [1.0%]  (false,exec)
  # .MEMD.2094_14 = VDEF .MEMD.2094_13
  dstD.1321 = srcD.1320;
  # SUCC: 5 [100.0%]  (fallthru,exec)

  # BLOCK 5 freq:1815
  # PRED: 7 [98.9%]  (true,exec) 4 [100.0%]  (fallthru,exec)
  # iD.1319_19 = PHI iD.1319_9(7), 0(4)
  # ivtmp.25D.2120_17 = PHI ivtmp.25D.2120_10(7), ivtmp.25D.2120_26(4)
  # VUSE .MEMD.2094_14
  D.2091_7 = MEM[index: ivtmp.25D.2120_17];
  ivtmp.25D.2120_10 = ivtmp.25D.2120_17 + 1;
  D.2090_22 = (unsigned charD.10) iD.1319_19;
  if (D.2091_7 != D.2090_22)
goto bb 6;
  else
goto bb 7;
  # SUCC: 6 [4.5%]  (true,exec) 7 [95.5%]  (false,exec)

  # BLOCK 6 freq:82
  # PRED: 5 [4.5%]  (true,exec)
  # VUSE .MEMD.2094_14
  abortD.823 ();
  # SUCC:

  # BLOCK 7 freq:1733
  # PRED: 5 [95.5%]  (false,exec)
  iD.1319_9 = iD.1319_19 + 1;
  if (iD.1319_9 != 100)
goto bb 5;
  else
goto bb 8;
  # SUCC: 5 [98.9%]  (true,exec) 8 [1.1%]  (false,exec)

  # BLOCK 8 freq:18
  # PRED: 7 [1.1%]  (false,exec)
  # VUSE .MEMD.2094_14
  exitD.869 (0);
  # SUCC:

}



Partition map 

Partition 2 (ivtmp.20_2 - 2 )
Partition 7 (D.2091_7 - 7 )
Partition 9 (i_9 - 9 )
Partition 10 (ivtmp.25_10 - 10 )
Partition 11 (.MEM_11(D) - 11 )
Partition 12 (.MEM_12 - 12 )
Partition 13 (.MEM_13 - 13 )
Partition 14 (.MEM_14 - 14 )
Partition 16 (ivtmp.20_16 - 16 )
Partition 17 (ivtmp.25_17 - 17 )
Partition 19 (i_19 - 19 )
Partition 22 (D.2090_22 - 22 )
Partition 23 (ivtmp.20_23 - 23 )
Partition 24 (ivtmp.25_24 - 24 )
Partition 25 (ivtmp.25_25 - 25 )
Partition 26 (ivtmp.25_26 - 26 )
Partition 27 (D.2124_27 - 27 )
Partition 29 (D.2126_29 - 29 )
Partition 30 (D.2090_30 - 30 )
Partition 31 (src.29_31 - 31 )
Partition 32 (D.2128_32 - 32 )


Partition map 

Partition 0 (ivtmp.20_2 - 2 )
Partition 1 (i_9 - 9 )
Partition 2 (ivtmp.25_10 - 10 )
Partition 3 (ivtmp.20_16 - 16 )
Partition 4 (ivtmp.25_17 - 17 )
Partition 5 (i_19 - 19 )
Partition 6 (ivtmp.20_23 - 23 )
Partition 7 (ivtmp.25_24 - 24 )
Partition 8 (ivtmp.25_25 - 25 )
Partition 9 (ivtmp.25_26 - 26 )


Live on entry to BB2 : 

Live on entry to BB3 : ivtmp.20_23  ivtmp.25_26  

Live on entry to BB4 : ivtmp.25_26  

Live on entry to BB5 : 

Live on entry to BB6 : 

Live on entry to BB7 : ivtmp.25_10  i_19  

Live on entry to BB8 : 

Conflict graph:
0: 6
3: 6
6: 0, 3
7: 9
8: 9
9: 7, 8

After sorting:
Sorted Coalesce list:
(2) ivtmp.20_2 - ivtmp.20_16
(2) i_9 - i_19
(2) ivtmp

[Bug c/41440] New: SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-22 Thread hutchinsonandy at gcc dot gnu dot org
.29_26 = (unsigned int) dst[0];
  src.33_31 = (unsigned int) src;
  D.2132_32 = src.33_31 + 100;

bb 3:
  # ivtmp.24_1 = PHI ivtmp.24_16(3), ivtmp.24_23(2)
  # ivtmp.29_24 = PHI ivtmp.29_25(3), ivtmp.29_26(2)
  D.2128_27 = (unsigned char) ivtmp.24_1;
  D.2130_29 = (unsigned char) ivtmp.24_23;
  D.2090_30 = D.2128_27 - D.2130_29;
  MEM[index: ivtmp.24_1] = D.2090_30;
  ivtmp.24_16 = ivtmp.24_1 + 1;
  MEM[index: ivtmp.29_24] = 0;
  ivtmp.29_25 = ivtmp.29_24 + 1;
  if (ivtmp.24_16 != D.2132_32)
goto bb 3;
  else
goto bb 4;

bb 4:
  dst = src;

bb 5:
  # i_19 = PHI i_9(7), 0(4)
  # ivtmp.29_17 = PHI ivtmp.29_10(7), ivtmp.29_26(4)
  D.2091_7 = MEM[index: ivtmp.29_17];
  ivtmp.29_10 = ivtmp.29_17 + 1;
  D.2090_22 = (unsigned char) i_19;
  if (D.2091_7 != D.2090_22)
goto bb 6;
  else
goto bb 7;

bb 6:
  abort ();

bb 7:
  i_9 = i_19 + 1;
  if (i_9 != 100)
goto bb 5;
  else
goto bb 8;

bb 8:
  exit (0);

}

=
RTL EXPANDER FROM AVR.MD


(define_expand movmemhi
  [(parallel [(set (match_operand:BLK 0 memory_operand )
  (match_operand:BLK 1 memory_operand ))
  (use (match_operand:HI 2 const_int_operand ))
  (use (match_operand:HI 3 const_int_operand ))])]
  
  {
  int prob;
  HOST_WIDE_INT count;
  enum machine_mode mode;
  rtx label = gen_label_rtx ();
  rtx loop_reg;
  rtx jump;

  /* Copy pointers into new psuedos - they will be changed.  */
  rtx addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
  rtx addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));

  /* Create rtx for tmp register - we use this as scratch.  */
  rtx tmp_reg_rtx  = gen_rtx_REG (QImode, TMP_REGNO);

  if (GET_CODE (operands[2]) != CONST_INT)
FAIL;

  count = INTVAL (operands[2]);
  if (count = 0)
FAIL;

  /* Work out branch probability for latter use.  */
  prob = REG_BR_PROB_BASE - REG_BR_PROB_BASE / count;

  /* See if constant fit 8 bits.  */
  mode = (count  0x100) ? QImode : HImode;
  /* Create loop counter register.  */
  loop_reg = copy_to_mode_reg (mode, gen_int_mode (count, mode));

  /* Now create RTL code for move loop.  */
  /* Label at top of loop.  */
  emit_label (label);

  /* Move one byte into scratch and inc pointer.  */
  emit_move_insn (tmp_reg_rtx, gen_rtx_MEM (QImode, addr1));
  emit_move_insn (addr1, gen_rtx_PLUS (Pmode, addr1, const1_rtx));

  /* Move to mem and inc pointer.  */
  emit_move_insn (gen_rtx_MEM (QImode, addr0), tmp_reg_rtx);
  emit_move_insn (addr0, gen_rtx_PLUS (Pmode, addr0, const1_rtx));

  /* Decrement count.  */
  emit_move_insn (loop_reg, gen_rtx_PLUS (mode, loop_reg, constm1_rtx));

  /* Compare with zero and jump if not equal. */
  emit_cmp_and_jump_insns (loop_reg, const0_rtx, NE, NULL_RTX, mode, 1,
   label);
  /* Set jump probability based on loop count.  */
  jump = get_last_insn ();
  add_reg_note (jump, REG_BR_PROB, GEN_INT (prob));
  DONE;
})


-- 
   Summary: SEG FAULT in CSE.C caused by bad RTL expansion
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/41440] SEG FAULT in CSE.C caused by bad RTL expansion

2009-09-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2009-09-23 02:49 
---
Created an attachment (id=18632)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18632action=view)
Expanded RTL

Expanded RTL dump


-- 


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



[Bug target/36609] AVR wrong code using incorrect RTL for test reversal pattern

2008-09-08 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-09-08 22:26 
---
Subject: Bug 36609

Author: hutchinsonandy
Date: Mon Sep  8 22:25:42 2008
New Revision: 140124

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140124
Log:
PR target/36609
* config/avr/avr.c (avr_reorg): Create RTL for reversed compare with zero.
* config/avr/avr.md  (QISI) : Define mode iterator.
(negated_tstmode) : Redefine as split using mode macro.
(reversed_tstqi): Define insn as reversed compare with zero.
(reversed_tsthi): Ditto.
(reversed_tstsi): Ditto.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md


-- 


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



[Bug target/36609] AVR wrong code using incorrect RTL for test reversal pattern

2008-09-08 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2008-09-08 22:45 
---
4.4 fixed.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug target/36609] AVR wrong code using incorrect RTL for test reversal pattern

2008-07-23 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2008-07-23 10:43 
---
Created an attachment (id=15945)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15945action=view)
Patch to target files

http://gcc.gnu.org/ml/gcc-patches/2008-07/msg00391.html


-- 


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



[Bug testsuite/36903] New: Generic vectorizarion test failures

2008-07-22 Thread hutchinsonandy at gcc dot gnu dot org
For AVR the following test fail. Probably since the day they were created.

For AVR there are no vectypes  so they all fail  message test

I don't know if these should be skipped as invalid or there is some significant
issue that warrant XFAIL.


FAIL: gcc.dg/tree-ssa/gen-vect-11.c scan-tree-dump-times vect vectorized 1
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-11a.c scan-tree-dump-times vect vectorized 1
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-2.c scan-tree-dump-times vect vectorized 1
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-25.c scan-tree-dump-times vect vectorized 2
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-26.c scan-tree-dump-times vect vectorized 1
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-26.c scan-tree-dump-times vect Alignment of
access forced using peeling 1
FAIL: gcc.dg/tree-ssa/gen-vect-28.c scan-tree-dump-times vect vectorized 1
loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-28.c scan-tree-dump-times vect Alignment of
access forced using peeling 1
FAIL: gcc.dg/tree-ssa/gen-vect-32.c scan-tree-dump-times vect vectorized 1
loops 1


-- 
   Summary: Generic vectorizarion test failures
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
GCC target triplet: avr-unknown-none


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



[Bug middle-end/36884] ifcvt poor optimization

2008-07-21 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-07-22 02:37 
---
4.2.2 has same issue.

Can someone benchmark -fno-if-conversion for AVR?

Transforms are made independent of target. BRANCH_COST is already 0 for avr.

Here is a related example. This time result  is a power of two so it needs a
more complicated shift.

int z;

int foo2(void)
{
  if ( ++z = 0)
  return 16;
  else
  return 0;

}

produces:
  24.LM2:
  25/*DEBUG: 0x00   12 */
  26  8091  lds r24,z
  27 0004 9091  lds r25,(z)+1
  28/*DEBUG: 0x44   8 */
  29 0008 0196  adiw r24,1
  30/*DEBUG: 0x51   12 */
  31 000a 9093  sts (z)+1,r25
  32 000e 8093  sts z,r24
  33/*DEBUG: 0x94   16 */
  34 0012 292F  mov r18,r25
  35 0014 220F  lsl r18
  36 0016 330B  sbc r19,r19
  37 0018 2795  ror r18
  38/*DEBUG: 0xd4   12 */
  39 001a 2095  com r18
  40 001c 3095  com r19
  41/*DEBUG: 0xf2   28 */
  42 001e 2227  clr r18
  43 0020 330F  lsl r19
  44 0022 221F  rol r18
  45 0024 3327  clr r19
  46/*DEBUG: 0x13   4   44 */
  47 0026 2295  swap r18
  48 0028 3295  swap r19
  49 002a 307F  andi r19,0xf0
  50 002c 3227  eor r19,r18
  51 002e 207F  andi r18,0xf0
  52 0030 3227  eor r19,r18
  53.LM3:
  54/*DEBUG: 0x19   6   4 */
  55 0032 C901  movw r24,r18
  56/* epilogue start */
  57/*DEBUG: 0x1a   1   4 */
  58 0034 0895  ret

If I played around with mode of operands I'm sure I could do worse.


-- 


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



[Bug tree-optimization/36792] [4.4 Regression] Revision 137631 causes many failures

2008-07-20 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2008-07-20 13:57 
---
Similarly Platform: avr-unknown-none

4.4.0 20080718 (experimental) [trunk revision 137967]

FAIL: gcc.dg/tree-ssa/ssa-fre-13.c scan-tree-dump fre Inserted .* a
FAIL: gcc.dg/tree-ssa/ssa-fre-13.c scan-tree-dump fre Replaced
tmp1_.\\(D\\)-data
FAIL: gcc.dg/tree-ssa/ssa-fre-14.c scan-tree-dump fre Inserted .* a
FAIL: gcc.dg/tree-ssa/ssa-fre-14.c scan-tree-dump fre Replaced tmp1.data
FAIL: gcc.dg/tree-ssa/ssa-fre-17.c scan-tree-dump fre Replaced
f.doms\\[0\\].dom with i_
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre Inserted pretmp 1
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre Replaced a.u.f with
pretmp 3
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre Replaced a.u.k with
j 1
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump fre =
VIEW_CONVERT_EXPRfloat\\(j_
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump optimized return j
FAIL: gcc.dg/tree-ssa/ssa-fre-8.c scan-tree-dump-times fre Replaced u.f with
pretmp 2
FAIL: gcc.dg/tree-ssa/ssa-fre-8.c scan-tree-dump-times fre Inserted pretmp 2
FAIL: gcc.dg/tree-ssa/ssa-fre-9.c scan-tree-dump-times fre Eliminated: 1 2
FAIL: gcc.dg/tree-ssa/ssa-fre-9.c scan-tree-dump-times fre Insertions: 1 2
FAIL: gcc.dg/tree-ssa/ssa-pre-15.c scan-tree-dump optimized = 0;


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||hutchinsonandy at gcc dot
   ||gnu dot org


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



[Bug middle-end/36884] New: ifcvt poor optimization

2008-07-20 Thread hutchinsonandy at gcc dot gnu dot org
If conversion is causing extraordinary bad code for AVR.
This occurs on 4.3 4.4 is no better.

Testcase:

int z;

int foo2(void)
{
  return ( ++z = 0);
}

Conversion replaces if using store flag. However, there appears to be no
account of relative costs and rather bad interactions with mode narrowing and
widening

After conversion we have:

z++
Extract upper byte of 'z'
Sign extend
One complement
Shift right 15


RTL prior to ce1 pass:

;; Pred edge  ENTRY [100.0%]  (fallthru)
(note 3 0 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(note 2 3 5 2 NOTE_INSN_FUNCTION_BEG)

(insn 5 2 6 2 test1.c:15 (set (reg:HI 43 [ z ])
(mem/c/i:HI (symbol_ref:HI (z) var_decl 0x7fe000b0 z) [3 z+0 S2
A8])) 10 {*movhi} (nil))

(insn 6 5 7 2 test1.c:15 (set (reg:HI 41 [ z.5 ])
(plus:HI (reg:HI 43 [ z ])
(const_int 1 [0x1]))) 25 {addhi3} (expr_list:REG_DEAD (reg:HI 43 [
z ])
(nil)))

(insn 7 6 8 2 test1.c:15 (set (mem/c/i:HI (symbol_ref:HI (z) var_decl
0x7fe000b0 z) [3 z+0 S2 A8])
(reg:HI 41 [ z.5 ])) 10 {*movhi} (nil))

(insn 8 7 9 2 test1.c:15 (set (reg:HI 44)
(const_int 0 [0x0])) 10 {*movhi} (nil))

(insn 9 8 10 2 test1.c:15 (set (cc0)
(reg:HI 41 [ z.5 ])) 95 {tsthi} (expr_list:REG_DEAD (reg:HI 41 [ z.5 ])
(nil)))

(jump_insn 10 9 25 2 test1.c:15 (set (pc)
(if_then_else (lt (cc0)
(const_int 0 [0x0]))
(label_ref 12)
(pc))) 109 {branch} (expr_list:REG_BR_PROB (const_int 2100 [0x834])
(nil)))
;; End of basic block 2 - ( 4 3)
;; lr  out   28 [r28] 32 [__SP_L__] 34 [argL] 44
;; live  out 28 [r28] 32 [__SP_L__] 34 [argL] 44





RTL after ce1:

(note 2 3 5 2 NOTE_INSN_FUNCTION_BEG)

(insn 5 2 6 2 test1.c:15 (set (reg:HI 43 [ z ])
(mem/c/i:HI (symbol_ref:HI (z) var_decl 0x7fe000b0 z) [3 z+0 S2
A8])) 10 {*movhi} (nil))

(insn 6 5 7 2 test1.c:15 (set (reg:HI 41 [ z.5 ])
(plus:HI (reg:HI 43 [ z ])
(const_int 1 [0x1]))) 25 {addhi3} (expr_list:REG_DEAD (reg:HI 43 [
z ])
(nil)))

(insn 7 6 8 2 test1.c:15 (set (mem/c/i:HI (symbol_ref:HI (z) var_decl
0x7fe000b0 z) [3 z+0 S2 A8])
(reg:HI 41 [ z.5 ])) 10 {*movhi} (nil))

(insn 8 7 9 2 test1.c:15 (set (reg:HI 44)
(const_int 0 [0x0])) 10 {*movhi} (nil))

(insn 9 8 35 2 test1.c:15 (set (cc0)
(reg:HI 41 [ z.5 ])) 95 {tsthi} (expr_list:REG_DEAD (reg:HI 41 [ z.5 ])
(nil)))

(insn 35 9 36 2 test1.c:15 (set (reg:QI 49)
(subreg:QI (reg:HI 41 [ z.5 ]) 1)) 4 {*movqi} (nil))

(insn 36 35 37 2 test1.c:15 (set (reg:HI 48)
(sign_extend:HI (reg:QI 49))) 84 {extendqihi2} (nil))

(insn 37 36 38 2 test1.c:15 (set (reg:HI 50)
(not:HI (reg:HI 48))) 82 {one_cmplhi2} (nil))

(insn 38 37 32 2 test1.c:15 (set (reg:HI 44)
(lshiftrt:HI (reg:HI 50)
(const_int 15 [0xf]))) 71 {lshrhi3} (nil))

(insn 32 38 33 2 test1.c:16 (set (reg:QI 24 r24)
(subreg:QI (reg:HI 44) 0)) 4 {*movqi} (nil))

(insn 33 32 23 2 test1.c:16 (set (reg:QI 25 r25 [+1 ])
(subreg:QI (reg:HI 44) 1)) 4 {*movqi} (expr_list:REG_DEAD (reg:HI 44)
(nil)))



Final (annotated) code:


  22/* prologue: frame size=0 */
  23/* prologue end (size=0) */
  24.LM2:
  25  8091  lds r24,z
  26 0004 9091  lds r25,(z)+1
  27 0008 0196  adiw r24,1
  28 000a 9093  sts (z)+1,r25
  29 000e 8093  sts z,r24
  30 0012 892F  mov r24,r25
  31 0014 9927  clr r25  ;SIGN EXTEND
  32 0016 87FD  sbrc r24,7 ;ditto
  33 0018 9095  com r25 ; ditto
  34 001a 8095  com r24 ; ONE'SCOMPLEMENT
  35 001c 9095  com r25 ; ditto
  36.LM3:
  37 001e 8827  clr r24 ;LSHIFT 15
  38 0020 990F  lsl r25 ; ditto
  39 0022 881F  rol r24 ; ditto
  40 0024 9927  clr r25 ; ditto
  41/* epilogue: frame size=0 */
  42 0026 0895  ret


-- 
   Summary: ifcvt poor optimization
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
GCC target triplet: avr-unknown-none


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



[Bug testsuite/36285] gcc.dg/compat/struct-by-value-xxx improper test for AVR target

2008-07-02 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2008-07-02 22:32 
---
Subject: Bug 36285

Author: hutchinsonandy
Date: Wed Jul  2 22:31:11 2008
New Revision: 137396

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=137396
Log:
PR testsuite/36285
* gcc.dg/compat/struct-by-value-16_x.c: Move some tests to new file to reduce
code size.
* gcc.dg/compat/struct-by-value-16_y.c: Ditto.
* gcc.dg/compat/struct-by-value-16a_main.c: New file.
* gcc.dg/compat/struct-by-value-16a_x.c: Ditto.
* gcc.dg/compat/struct-by-value-16a_y.c: Ditto.
* gcc.dg/compat/struct-by-value-17_x.c: Move some tests to new file to reduce
code size.
* gcc.dg/compat/struct-by-value-17_y.c: Ditto.
* gcc.dg/compat/struct-by-value-17a_main.c: New file.
* gcc.dg/compat/struct-by-value-17a_x.c: Ditto.
* gcc.dg/compat/struct-by-value-17a_y.c: Ditto.
* gcc.dg/compat/struct-by-value-18_x.c: Move some tests to new file to reduce
code size.
* gcc.dg/compat/struct-by-value-18_y.c: Ditto.
* gcc.dg/compat/struct-by-value-18a_main.c: New file.
* gcc.dg/compat/struct-by-value-18a_x.c: Ditto.
* gcc.dg/compat/struct-by-value-18a_y.c: Ditto.

Added:
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c


-- 


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



[Bug middle-end/36598] Failed optimisation of return of struct argment in memcpy-1.c

2008-06-30 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #5 from hutchinsonandy at gcc dot gnu dot org  2008-06-30 22:39 
---
Subject: Bug 36598

Author: hutchinsonandy
Date: Mon Jun 30 22:38:34 2008
New Revision: 137298

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=137298
Log:
PR target/36598
* gcc.dg/memcpy-1.c: Mark test XFAIL for avr target.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/memcpy-1.c


-- 


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



[Bug target/36609] New: AVR wrong code using incorrect RTL for test reversal pattern

2008-06-23 Thread hutchinsonandy at gcc dot gnu dot org
I found problem with AVR test instructions such used by c/c++ code (x0)
and demonstrated by testsuite test gcc.c-torture/execute/pr22493-1.c

#include limits.h
extern void abort ();
extern void exit (int);
void f(int i)
{
  if (i0)
abort();
  i = -i;
  if (i0)
return;
  abort ();
}

int main(int argc, char *argv[])
{
  f(INT_MIN);
  exit (0);
}


Compiling this with:

avr-gcc -c -mmcu=atmega128 -I. -w  -Os  -fwrapv  -mmcu=atmega128 -Wall
-Wstrict-prototypes -Wa,-ahlms=test.s  -std=gnu99 test.c -o test.o


produces wrong code.

An integer test x0 is translated into RTL:

CC0=Rx

from which we create AVR assembler code

TST Rx

which is equivalent to CMP Rx,0


AVR target also have negated_tst  RTL patterns to reverse tests in avr_reorg so
that we can match the available branches on AVR. For example AVR has BRLT and
BRGE but not BRLE and BRGT.

So

CC0 = Rx
Jump LE

becomes reorganized as

CC0 = NEG:xx(Rx)
Jump GE

which emits the following code via  define_insn *negated_tst.

CMP 0,Rx
BRGE


For such test reversals  the final code is correct. However, the intermediate
RTL used by translation is WRONG

CC0=Rx
Jump LE

is NOT equivalent to

CC0 = NEG:xx(Rx)
Jump GE

For test reversal the problem is hidden - 2 wrongs making a right in this case.
BUT the bug appears when we have a normal code sequence such as

NEG:xx(Rx)
CC0 = Rx

which the combine phase will match against the RTL of *negated_tst and result
in assembler code of:

CMP 0,Rx

which is incorrect. Consider the case where Rx= -32768

NEG:HI(-32768) = -32768
CC0 = -32768 = Negative correct!

but the replacment:

CMP 0,-32768 =Positive - WRONG


The fix is to redefine  the *negated_tst RTL patterns to use correct COMPARES
 and have avr_reorg to emit the corrected RTL.


(define_insn *reversed_tsthi
  [(set (cc0)
(compare (const_int 0)
(match_operand:HI 0 register_operand  r)))

Test reversals will be unaffected. But now combine won't find any bad RTL.

I have not studied to see if the above RTL is ever generated. If it is, it is
perfectly safe.


-- 
   Summary: AVR wrong code using incorrect RTL for test reversal
pattern
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: avr-unknown-none


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



[Bug c/36598] New: Failed optimisation of return of struct argment in memcpy-1.c

2008-06-22 Thread hutchinsonandy at gcc dot gnu dot org
Testcase gcc.dg/memcpy-1.c fails on AVR target.

Failure occurs because the return value is not simplified to avoid memcpy. This
test works on i686 and I can't see why same optimization should not apply to
AVR

Test is:

/* { dg-do compile } */
/* { dg-options -O2 -fdump-tree-optimized } */
/* { dg-final { scan-tree-dump-times nasty_local 0 optimized } } */
/* { dg-final { cleanup-tree-dump optimized } } */
struct a {int a,b,c;} a;
int test(struct a a)
{
struct a nasty_local;
__builtin_memcpy (nasty_local,a, sizeof(a));
return nasty_local.a;
}

On i686 we get:

;; Function test (test)

Analyzing Edge Insertions.
test (struct a a)
{
bb 2:
  return a.a;

}


BUT on AVR we get:


;; Function test (test)

Analyzing Edge Insertions.
test (struct a a)
{
  struct a nasty_local;

bb 2:
  nasty_local = a;
  return nasty_local.a;

}

I have confirmed the final AVR code is suboptimal.


-- 
   Summary: Failed optimisation of return of struct argment in
memcpy-1.c
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


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



[Bug c/36598] Failed optimisation of return of struct argment in memcpy-1.c

2008-06-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-06-22 14:33 
---
Thanks for information

--param sra-max-structure-size=32 does indeed remove test failure and produces
optimal code.

But changing the testcase does not remove the optimization problem - unless
sra-max-structure-size was always used. So there is problem somewhere else to
fix.

See also:

http://gcc.gnu.org/ml/gcc-patches/2007-12/msg01144.html

Andy


-- 


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



[Bug c/36598] Failed optimisation of return of struct argment in memcpy-1.c

2008-06-22 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2008-06-22 16:11 
---
Quite possibly due to cost metrics. They are far from ideal.

Will mark test XFAIL until we can investigate and fix.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||eric dot weddington at atmel
   ||dot com


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



[Bug c++/36460] No space between 's not always handled in C++0x

2008-06-18 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-06-18 21:49 
---
Subject: Bug 36460

Author: hutchinsonandy
Date: Wed Jun 18 21:48:50 2008
New Revision: 136919

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136919
Log:
PR c/36460
* gcc.dg/utf32-1.c: Mark xfail for AVR target.
* gcc.dg/utf32-2.c: Ditto.
* gcc.dg/utf32-3.c: Ditto.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/utf32-1.c
trunk/gcc/testsuite/gcc.dg/utf32-2.c
trunk/gcc/testsuite/gcc.dg/utf32-3.c


-- 


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



[Bug testsuite/36284] gcc.dg-struct-layout fails AVR target - multiple reasons

2008-06-18 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-06-18 21:54 
---
Subject: Bug 36284

Author: hutchinsonandy
Date: Wed Jun 18 21:53:20 2008
New Revision: 136920

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136920
Log:
PR testsuite/36284
* gcc.dg/compat/struct-layout-1_generate.c (switchfiles): Require int32plus for
generated main files.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c


-- 


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



[Bug c/36571] New: Default untyped return for AVR is byte register.

2008-06-18 Thread hutchinsonandy at gcc dot gnu dot org
Test testsuite/gcc.dg/builtin-return-1.c will fail for avr target.

Default implementation of builtin-return-1 is untyped return of a single
register.
Which is R25 and only 1 byte. This is not int as test expects.
So high byte may and does get overwritten before outer return.

The test may be invalid, but this is also reminder that AVR target does not
have a complete definition for untyped return. The default is pretty useless.

Test with be marked XFAIL.


-- 
   Summary: Default untyped return for AVR is byte register.
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-nne


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



[Bug middle-end/36571] Default untyped return for AVR is byte register.

2008-06-18 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2008-06-18 23:00 
---
Subject: Bug 36571

Author: hutchinsonandy
Date: Wed Jun 18 22:59:41 2008
New Revision: 136926

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136926
Log:
PR c/36571
* gcc.dg/builtin-return-1.c: Mark as xfail on AVR.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/builtin-return-1.c


-- 


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



[Bug testsuite/36284] gcc.dg-struct-layout fails AVR target - multiple reasons

2008-06-18 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #3 from hutchinsonandy at gcc dot gnu dot org  2008-06-19 02:16 
---
Testcase fixed for 4.4


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/36561] New: store using long array index not hoisted out of loop

2008-06-17 Thread hutchinsonandy at gcc dot gnu dot org
Testsuite test  gcc.dg/tree-ssa/loop35.c fails for avr target for test3().

This test uses long array index. Tests with int or char index get hoisted as
expected.

void test3(unsigned long b)
{
  unsigned i;

  /* And here.  */
  for (i = 0; i  100; i++)
{
  arr[b+8].X += i;
  arr[b+9].X += i;
}
}

Richard Guenther indicates:
 This is because the alias-oracle for store-motion doesn't handle conversions
 to sizetype well in the offset disambiguation.


-- 
   Summary: store using long array  index not hoisted out of loop
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
GCC target triplet: avr-unkown-none


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



[Bug target/36336] ICE push_reload - psuedo reg_equiv_constant

2008-06-15 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #6 from hutchinsonandy at gcc dot gnu dot org  2008-06-15 18:25 
---
Subject: Bug 36336

Author: hutchinsonandy
Date: Sun Jun 15 18:24:27 2008
New Revision: 136818

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136818
Log:
PR target/36336
* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
reg_equiv_constant.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.h


-- 


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



[Bug target/36336] ICE push_reload - psuedo reg_equiv_constant

2008-06-15 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #7 from hutchinsonandy at gcc dot gnu dot org  2008-06-15 18:35 
---
Subject: Bug 36336

Author: hutchinsonandy
Date: Sun Jun 15 18:34:45 2008
New Revision: 136819

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136819
Log:
PR target/36336
* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
reg_equiv_constant.

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


-- 


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




[Bug target/36336] ICE push_reload - psuedo reg_equiv_constant

2008-06-15 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #8 from hutchinsonandy at gcc dot gnu dot org  2008-06-15 18:36 
---
Fixed 4.4 and 4.3


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-10 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #1 from hutchinsonandy at gcc dot gnu dot org  2008-06-11 02:35 
---
Please post command line used to compile and assembler produced.

I cannot reproduce this on 4.4 or 4.2.2.
At high optimisation (-Os) it compiles to load PORTC with 3 directly.
(as one would expect):

  13/* prologue: frame size=0 */
  14/* prologue end (size=0) */
  15  8FE0  ldi r24,lo8(15)
  16 0002 87B9  out 39-0x20,r24
  17 0004 83E0  ldi r24,lo8(3)
  18 0006 90E0  ldi r25,hi8(3)
  19 0008 88B9  out 40-0x20,r24
  20 000a 80E0  ldi r24,lo8(0)
  21 000c 90E0  ldi r25,hi8(0)
  22/* epilogue: frame size=0 */
  23 000e 0895  ret


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||eric dot weddington at atmel
   ||dot com


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



[Bug middle-end/36447] [4.4 Regression] simplify_subreg ICE with right shift more than length type AVR

2008-06-09 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2008-06-09 22:39 
---
Subject: Bug 36447

Author: hutchinsonandy
Date: Mon Jun  9 22:38:34 2008
New Revision: 136602

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136602
Log:
PR middle-end/36447
* simplify-rtx.c (simplify_subreg): Add check for shift count greater than
size.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/simplify-rtx.c


-- 


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



[Bug testsuite/36285] gcc.dg/compat/struct-by-value-xxx improper test for AVR target

2008-06-09 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-06-09 22:49 
---
Subject: Bug 36285

Author: hutchinsonandy
Date: Mon Jun  9 22:48:37 2008
New Revision: 136604

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136604
Log:
PR testsuite/36285
* gcc.dg/compat/struct-return-10_y.c: Remove test_va.
* gcc.dg/compat/vector-defs.h: Add check for availability of 8 byte double.
* gcc.dg/compat/struct-layout-1_test.h: Change bitfield to match integer size.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h
trunk/gcc/testsuite/gcc.dg/compat/struct-return-10_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-defs.h


-- 


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



[Bug c/36470] sizeof UTF-32 is 2 on AVR

2008-06-09 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #2 from hutchinsonandy at gcc dot gnu dot org  2008-06-10 03:21 
---
Fixing the testcase is easy, That is how i found problem.  Two wrongs make a
right!

It is not a priority but it seems like the suggestions is right way to fix.
I'll mark as XFAIL sometime soon.


-- 


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



[Bug target/36467] [avr] Missed optimization with pointer arithmetic and mul*

2008-06-08 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #4 from hutchinsonandy at gcc dot gnu dot org  2008-06-08 18:20 
---
It makes sense in one respect
We don't have fast shift by 4 bits and code defaults to loop for Os. Seems we
should be selective as MUL is indeed shorter.

Though I think gcc may be confused by our poor cost data and perhaps was alsp
mislead into using shift instead of MUL.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-06-08 18:20:52
   date||


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



[Bug c/36470] New: sizeof UTF-32 is 2 on AVR

2008-06-08 Thread hutchinsonandy at gcc dot gnu dot org
AVR fails gcc.dg/utf32-1.c execution test. 

As AVR has 16 bit int, I tried fixing this by using unsigned long for char_32.

This failed, I was surprised to find this is apparently due to incorrect size
of UTF-32 characters so that:

sizeof (U'\0')
sizeof (U'\u2029')
sizeof (U'\U00064321')

all give value of 2.

So it would seem size has been set as sizeof(int) perhaps? 

I can assign 32 bit values ok - just that sizeof says they are only 16 bits.

The modified testcase using 32 bit char_32t compiles to abort(), so I figure
its not a target issue.


/** Change this to unsigned long for AVR/
typedef unsigned int char32_t;

extern void abort (void);

char32_tc0 = U'a';
char32_tc1 = U'\0';
char32_tc2 = U'\u0024';
char32_tc3 = U'\u2029';
char32_tc4 = U'\U00064321';

#define A   0x0061
#define D   0x0024
#define X   0x2029
#define Y   0x00064321

int main ()
{
if (sizeof (U'a') != sizeof (char32_t))
abort ();
if (sizeof (U'\0') != sizeof (char32_t))
abort ();
if (sizeof (U'\u0024') != sizeof (char32_t))
abort ();
if (sizeof (U'\u2029') != sizeof (char32_t))
abort ();
if (sizeof (U'\U00064321') != sizeof (char32_t))
abort ();

if (c0 != A)
abort ();
if (c1 != 0x)
abort ();
if (c2 != D)
abort ();
if (c3 != X)
abort ();
if (c4 != Y)
abort ();
}


-- 
   Summary: sizeof UTF-32 is 2 on AVR
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-cygwin
GCC target triplet: avr-unknown-none


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



[Bug target/27386] AVR: wrong code generated when passing three uint64_t arguments to function

2008-06-07 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #17 from hutchinsonandy at gcc dot gnu dot org  2008-06-07 
15:49 ---
Subject: Bug 27386

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

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=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


-- 


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



[Bug target/34932] [avr] ICE in reload

2008-06-07 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #7 from hutchinsonandy at gcc dot gnu dot org  2008-06-07 15:49 
---
Subject: Bug 34932

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

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=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


-- 


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



[Bug target/30243] [4.1/4.2/4.3/4.4 Regression][avr] signbit() causes an internal compiler error

2008-06-07 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #12 from hutchinsonandy at gcc dot gnu dot org  2008-06-07 
15:49 ---
Subject: Bug 30243

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

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=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


-- 


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



[Bug target/30243] [4.1/4.2/4.3/4.4 Regression][avr] signbit() causes an internal compiler error

2008-06-04 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #10 from hutchinsonandy at gcc dot gnu dot org  2008-06-04 
22:00 ---
Subject: Bug 30243

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

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=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


-- 


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



[Bug target/27386] AVR: wrong code generated when passing three uint64_t arguments to function

2008-06-04 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #15 from hutchinsonandy at gcc dot gnu dot org  2008-06-04 
22:03 ---
Subject: Bug 27386

Author: hutchinsonandy
Date: Wed Jun  4 22:02:57 2008
New Revision: 136377

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136377
Log:
PR target/27386
* config/avr/avr.h: (PUSH_ROUNDING): Remove.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.h


-- 


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



[Bug target/30243] [4.1/4.2/4.3/4.4 Regression][avr] signbit() causes an internal compiler error

2008-06-04 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #11 from hutchinsonandy at gcc dot gnu dot org  2008-06-04 
22:05 ---
Fixed 4.4
Back port to 4.3.2 when its open.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|4.2.5   |4.3.2


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



[Bug target/27386] AVR: wrong code generated when passing three uint64_t arguments to function

2008-06-04 Thread hutchinsonandy at gcc dot gnu dot org


--- Comment #16 from hutchinsonandy at gcc dot gnu dot org  2008-06-04 
22:06 ---
Fixed 4.4


-- 

hutchinsonandy at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.3.2


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



  1   2   >