public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: fix avr compile/limits-externdecl.c failures
@ 2013-05-13 17:36 Joern Rennecke
  2013-05-14 11:16 ` Denis Chertykov
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 2013-05-13 17:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: chertykov, aesok, eric.weddington

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

All the gcc.c-torture/compile/limits-externdecl.c currently give an
error: size of array is too large, followed by an ICE in
avr_encode_section_info, which goes on to try to find the address space
of error_mark_node.

Given the size of the array, it makes sense for the test to give an error
where POINTER_SIZE is 16 bit, but then, we should mark this as an expected
error for this target.
Moreover, we shouldn't ICE after the error.

The attached patch implements both these changes.

regression tested for i686-pc-linux-gnu X avr, Running target atmega128-sim

[-- Attachment #2: tmp --]
[-- Type: text/plain, Size: 1391 bytes --]

2013-05-13  Joern Rennecke <joern.rennecke@embecosm.com>

gcc:
	* config/avr/avr.c (avr_encode_section_info): Bail out if the type
	is error_mark_node.
gcc/testsuite:
	* testsuite/gcc.c-torture/compile/limits-externdecl.c [target avr-*-*]:
	Expect "size of array is too large" error.

Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c	(revision 198829)
+++ config/avr/avr.c	(working copy)
@@ -8324,7 +8324,11 @@ avr_encode_section_info (tree decl, rtx
       && SYMBOL_REF == GET_CODE (XEXP (rtl, 0)))
    {
       rtx sym = XEXP (rtl, 0);
-      addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
+      tree type = TREE_TYPE (decl);
+
+      if (type == error_mark_node)
+	return;
+      addr_space_t as = TYPE_ADDR_SPACE (type);
 
       /* PSTR strings are in generic space but located in flash:
          patch address space.  */
Index: testsuite/gcc.c-torture/compile/limits-externdecl.c
===================================================================
--- testsuite/gcc.c-torture/compile/limits-externdecl.c	(revision 198829)
+++ testsuite/gcc.c-torture/compile/limits-externdecl.c	(working copy)
@@ -52,4 +52,4 @@ #define LIM6(x) LIM5(x##0) LIM5(x##1) LI
 REFERENCE references[] = {
   LIM5 (X)
   0
-};
+}; /* { dg-error "size of array is too large" "" { target avr-*-* } } */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: fix avr compile/limits-externdecl.c failures
  2013-05-13 17:36 RFA: fix avr compile/limits-externdecl.c failures Joern Rennecke
@ 2013-05-14 11:16 ` Denis Chertykov
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Chertykov @ 2013-05-14 11:16 UTC (permalink / raw)
  To: Joern Rennecke
  Cc: gcc-patches,
	Анатолий
	Соколов,
	Weddington, Eric

2013/5/13 Joern Rennecke <joern.rennecke@embecosm.com>
>
> All the gcc.c-torture/compile/limits-externdecl.c currently give an
> error: size of array is too large, followed by an ICE in
> avr_encode_section_info, which goes on to try to find the address space
> of error_mark_node.
>
> Given the size of the array, it makes sense for the test to give an error
> where POINTER_SIZE is 16 bit, but then, we should mark this as an expected
> error for this target.
> Moreover, we shouldn't ICE after the error.
>
> The attached patch implements both these changes.
>
> regression tested for i686-pc-linux-gnu X avr, Running target atmega128-sim
>
> 2013-05-13  Joern Rennecke <joern.rennecke@embecosm.com>
>
> gcc:
>         * config/avr/avr.c (avr_encode_section_info): Bail out if the type
>         is error_mark_node.
> gcc/testsuite:
>         * testsuite/gcc.c-torture/compile/limits-externdecl.c [target avr-*-*]:
>         Expect "size of array is too large" error.
>

Applied.

Denis.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-14 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 17:36 RFA: fix avr compile/limits-externdecl.c failures Joern Rennecke
2013-05-14 11:16 ` Denis Chertykov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).