diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-05-13 14:26:13 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-05-13 14:26:13 +0300 |
commit | 5864e2e380fec584938f62b675d42fdec1a91e7d (patch) | |
tree | 7982a27459c0d3d822987fdc81bb6f7a0bdf9049 /debian/patches/illumos-pragma-align.diff | |
parent | 42156b5190f4fa150e1fab6777eb81e69d4db8c9 (diff) | |
download | gcc-9-5864e2e380fec584938f62b675d42fdec1a91e7d.tar.gz |
Add changes from Dyson gcc-5 (not tested at all)
Diffstat (limited to 'debian/patches/illumos-pragma-align.diff')
-rw-r--r-- | debian/patches/illumos-pragma-align.diff | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/patches/illumos-pragma-align.diff b/debian/patches/illumos-pragma-align.diff new file mode 100644 index 0000000..b8ca929 --- /dev/null +++ b/debian/patches/illumos-pragma-align.diff @@ -0,0 +1,46 @@ +Description: Allow #pragma align to be used after a variable is declared + GCC mandates that #pragma align precede any declaration, Sun C does not. + See http://wiki.illumos.org/display/illumos/GCC+Modifications + +Index: gcc-5/src/gcc/config/sol2-c.c +=================================================================== +--- gcc-5.orig/src/gcc/config/sol2-c.c ++++ gcc-5/src/gcc/config/sol2-c.c +@@ -125,8 +125,9 @@ solaris_pragma_align (cpp_reader *pfile + { + tree decl = identifier_global_value (t); + if (decl && DECL_P (decl)) +- warning (0, "%<#pragma align%> must appear before the declaration of " +- "%D, ignoring", decl); ++ decl_attributes (&decl, build_tree_list (get_identifier ("aligned"), ++ build_tree_list (NULL, x)), ++ 0); + else + solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x), + solaris_pending_aligns); +Index: gcc-5/src/gcc/testsuite/gcc.dg/pragma-align-2.c +=================================================================== +--- gcc-5.orig/src/gcc/testsuite/gcc.dg/pragma-align-2.c ++++ gcc-5/src/gcc/testsuite/gcc.dg/pragma-align-2.c +@@ -26,9 +26,9 @@ void abort (void); + #pragma align bad_align /* { dg-warning "malformed" } */ + #pragma align 1(bad_align /* { dg-warning "malformed" } */ + +-int x, x1, x2, x4, x8, y8, z8, x16, x32, x64, x128, y128, z128; ++int x1, x2, x4, x8, y8, z8, x16, y16, x32, x64, x128, y128, z128 + +-#pragma align 16(x) /* { dg-warning "must appear before" } */ ++#pragma align 16(y16) + + int + main () +@@ -48,6 +48,9 @@ main () + if (__alignof__ (x16) < 16) + abort (); + ++ if (__alignof__ (y16) < 16) ++ abort (); ++ + if (__alignof__ (x32) < 32) + abort (); + |