Fix a regression in GCC 10/11/12 where some union structures
could get miscompiled when optimizations are enabled:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860
Taken from upstream:
https://gcc.gnu.org/g:16afe2e2862f3dd93c711d7f8d436dee23c6c34d
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 09d951a261b..420329f63f6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1647,7 +1647,18 @@ build_ref_for_offset (location_t loc, tree base, poly_int64 offset,
static tree
build_reconstructed_reference (location_t, tree base, struct access *model)
{
- tree expr = model->expr, prev_expr = NULL;
+ tree expr = model->expr;
+ /* We have to make sure to start just below the outermost union. */
+ tree start_expr = expr;
+ while (handled_component_p (expr))
+ {
+ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == UNION_TYPE)
+ start_expr = expr;
+ expr = TREE_OPERAND (expr, 0);
+ }
+
+ expr = start_expr;
+ tree prev_expr = NULL_TREE;
while (!types_compatible_p (TREE_TYPE (expr), TREE_TYPE (base)))
{
if (!handled_component_p (expr))
0cbdbe4a95f95bf8d87f'>refslogtreecommitdiff
|
Age | Commit message (Expand) | Author |
2020-12-15 | nar: Deduplicate files right as they are restored....This avoids having to traverse and re-read the files that we have just
restored, thereby reducing I/O.
* guix/serialization.scm (dump-file): New procedure.
(restore-file): Add #:dump-file parameter and honor it.
* guix/store/deduplication.scm (tee, dump-file/deduplicate): New
procedures.
* guix/nar.scm (restore-one-item): Pass #:dump-file to 'restore-file'.
(finalize-store-file): Pass #:deduplicate? #f to 'register-items'.
* tests/nar.scm <top level>: Call 'setenv' to set "NIX_STORE".
| Ludovic Courtès |
2020-12-15 | serialization: 'restore-file' sets canonical timestamp and permissions....* guix/serialization.scm (restore-file): Set the permissions and mtime
of FILE.
* guix/nar.scm (finalize-store-file): Pass #:reset-timestamps? #f to
'register-items'.
* tests/nar.scm (rm-rf): Add 'chmod' calls to ensure files are writable.
("write-file + restore-file with symlinks"): Ensure every file in OUTPUT
passes 'canonical-file?'.
* tests/guix-archive.sh: Run "chmod -R +w" before "rm -rf".
| Ludovic Courtès |
2020-12-15 | serialization: 'fold-archive' notifies about directory processing completion....* guix/serialization.scm (fold-archive): Call PROC with a
'directory-complete tag when done with a directory.
(restore-file): Handle it.
* guix/scripts/archive.scm (list-contents): Likewise.
* guix/scripts/challenge.scm (archive-contents): Likewise.
* tests/nar.scm ("write-file-tree + fold-archive"): Adjust accordingly.
| Ludovic Courtès |
2019-12-12 | serialization: Add 'fold-archive'....* guix/serialization.scm (read-contents): Remove.
(read-file-type, fold-archive): New procedures.
(restore-file): Rewrite in terms of 'fold-archive'.
* tests/nar.scm ("write-file-tree + fold-archive")
("write-file-tree + fold-archive, flat file"): New tests.
| Ludovic Courtès |
2019-01-18 | serialization: 'restore-file' errors out upon non-convertible file names....Fixes <https://bugs.gnu.org/33603>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
* guix/serialization.scm (port-conversion-strategy): New variable.
(restore-file): Parameterize it.
* tests/nar.scm ("restore-file with non-UTF8 locale"): New test.
| Ludovic Courtès |
2018-11-13 | deduplication: Restore directory mtime and permissions after deduplication....Fixes <https://bugs.gnu.org/33361>.
* guix/store/deduplication.scm (replace-with-link): Call 'set-file-time'
and 'chmod' after 'rename-file'.
* tests/nar.scm ("restore-file-set with directories (signed, valid)"):
New test.
| Ludovic Courtès |
2018-11-13 | tests: Check file canonicalization for 'restore-file-set'....* guix/tests.scm (canonical-file?): New procedure.
* tests/nar.scm ("restore-file-set (signed, valid)"): Check that every
item of FILES matches 'canonical-file?'.
| Ludovic Courtès |
2018-11-13 | tests: Remove check for a feature that appeared in Guile 2.0.10....* tests/nar.scm: Remove test for 'open-sha256-input-port'.
| Ludovic Courtès |