diff mbox

[java] Fix placement of #ifdef JCR_SECTION_NAME in class.c

Message ID 20120519210705.GA11852@hiauly1.hia.nrc.ca
State New
Headers show

Commit Message

John David Anglin May 19, 2012, 9:07 p.m. UTC
The attached change fixes a compilation error that occurs because
JCR_SECTION_NAME is not defined on hppa*-hpux.

Tested on hppa2.0w-hp-hpux11.11.

Ok for trunk?

Dave

Comments

Richard Biener May 21, 2012, 9:52 a.m. UTC | #1
On Sat, May 19, 2012 at 11:07 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> The attached change fixes a compilation error that occurs because
> JCR_SECTION_NAME is not defined on hppa*-hpux.
>
> Tested on hppa2.0w-hp-hpux11.11.
>
> Ok for trunk?

Ok.

Thanks,
Richard.

> Dave
> --
> J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
> National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
>
> 2012-05-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
>
>        PR java/52815
>        * class.c (emit_register_classes_in_jcr_section): Revise placement
>        of #ifdef JCR_SECTION_NAME.
>
> Index: class.c
> ===================================================================
> --- class.c     (revision 186553)
> +++ class.c     (working copy)
> @@ -2791,17 +2791,12 @@
>  static void
>  emit_register_classes_in_jcr_section (void)
>  {
> +#ifdef JCR_SECTION_NAME
>   tree klass, cdecl, class_array_type;
>   int i;
>   int size = VEC_length (tree, registered_class);
>   VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc, size);
>
> -#ifndef JCR_SECTION_NAME
> -  /* A target has defined TARGET_USE_JCR_SECTION,
> -     but doesn't have a JCR_SECTION_NAME.  */
> -  gcc_unreachable ();
> -#endif
> -
>   FOR_EACH_VEC_ELT (tree, registered_class, i, klass)
>     CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, build_fold_addr_expr (klass));
>
> @@ -2827,6 +2822,11 @@
>   relayout_decl (cdecl);
>   rest_of_decl_compilation (cdecl, 1, 0);
>   mark_decl_referenced (cdecl);
> +#else
> +  /* A target has defined TARGET_USE_JCR_SECTION,
> +     but doesn't have a JCR_SECTION_NAME.  */
> +  gcc_unreachable ();
> +#endif
>  }
>
>
diff mbox

Patch

Index: class.c
===================================================================
--- class.c	(revision 186553)
+++ class.c	(working copy)
@@ -2791,17 +2791,12 @@ 
 static void
 emit_register_classes_in_jcr_section (void)
 {
+#ifdef JCR_SECTION_NAME
   tree klass, cdecl, class_array_type;
   int i;
   int size = VEC_length (tree, registered_class);
   VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc, size);
 
-#ifndef JCR_SECTION_NAME
-  /* A target has defined TARGET_USE_JCR_SECTION,
-     but doesn't have a JCR_SECTION_NAME.  */
-  gcc_unreachable ();
-#endif
-
   FOR_EACH_VEC_ELT (tree, registered_class, i, klass)
     CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, build_fold_addr_expr (klass));
 
@@ -2827,6 +2822,11 @@ 
   relayout_decl (cdecl);
   rest_of_decl_compilation (cdecl, 1, 0);
   mark_decl_referenced (cdecl);
+#else
+  /* A target has defined TARGET_USE_JCR_SECTION,
+     but doesn't have a JCR_SECTION_NAME.  */
+  gcc_unreachable ();
+#endif
 }