public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix PR ada/82127
@ 2017-09-07 15:33 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2017-09-07 15:33 UTC (permalink / raw)
  To: gcc-patches

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

A small oversight in the implementation of component reordering.

Tested on x86_64-suse-linux, applied on mainline.


2017-09-07  Eric Botcazou  <ebotcazou@adacore.com>

	PR ada/82127
	* gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields
	in order of increasing position in more cases.

-- 
Eric Botcazou

[-- Attachment #2: pr82127.diff --]
[-- Type: text/x-patch, Size: 1041 bytes --]

Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 251812)
+++ gcc-interface/decl.c	(working copy)
@@ -9530,12 +9530,10 @@ copy_and_substitute_in_layout (Entity_Id
 	  save_gnu_tree (gnat_field, gnu_field, false);
       }
 
-  /* If there is a variant list, a selected variant and the fields all have a
+  /* If there is no variant list or a selected variant and the fields all have
      constant position, put them in order of increasing position to match that
-     of constant CONSTRUCTORs.  Likewise if there is no variant list but a REP
-     part, since the latter has been flattened in the process.  */
-  if ((gnu_variant_list.exists () ? selected_variant : gnu_rep_part != NULL)
-      && all_constant_pos)
+     of constant CONSTRUCTORs.  */
+  if ((!gnu_variant_list.exists () || selected_variant) && all_constant_pos)
     {
       const int len = list_length (gnu_field_list);
       tree *field_arr = XALLOCAVEC (tree, len), t = gnu_field_list;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-07 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 15:33 Fix PR ada/82127 Eric Botcazou

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).