public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] adjust shiftrt bitpos for endianness
@ 2020-09-23 23:23 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2020-09-23 23:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:118e7820efa48cf141be3b750ba10ea042e69025

commit 118e7820efa48cf141be3b750ba10ea042e69025
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Sep 17 08:29:24 2020 -0300

    adjust shiftrt bitpos for endianness

Diff:
---
 gcc/fold-const.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 081c41f7fbe..e39ab42049e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4686,7 +4686,7 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
   if ((inner == exp && and_mask == 0)
       || !poly_bitsize.is_constant (pbitsize)
       || !poly_bitpos.is_constant (pbitpos)
-      || *pbitsize < shiftrt
+      || *pbitsize <= shiftrt
       || offset != 0
       || TREE_CODE (inner) == PLACEHOLDER_EXPR
       /* Reject out-of-bound accesses (PR79731).  */
@@ -4697,7 +4697,8 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
 
   if (shiftrt)
     {
-      *pbitpos += shiftrt;
+      if (!*preversep ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN)
+	*pbitpos += shiftrt;
       *pbitsize -= shiftrt;
     }


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

* [gcc(refs/users/aoliva/heads/testme)] adjust shiftrt bitpos for endianness
@ 2020-09-17 11:43 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2020-09-17 11:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a463d049a6b67fdac6c730d37eaeb8b2ea9173fd

commit a463d049a6b67fdac6c730d37eaeb8b2ea9173fd
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Sep 17 08:29:24 2020 -0300

    adjust shiftrt bitpos for endianness

Diff:
---
 gcc/fold-const.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c835327dac9..d65d4a79816 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4686,7 +4686,7 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
   if ((inner == exp && and_mask == 0)
       || !poly_bitsize.is_constant (pbitsize)
       || !poly_bitpos.is_constant (pbitpos)
-      || *pbitsize < shiftrt
+      || *pbitsize <= shiftrt
       || offset != 0
       || TREE_CODE (inner) == PLACEHOLDER_EXPR
       /* Reject out-of-bound accesses (PR79731).  */
@@ -4697,7 +4697,8 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
 
   if (shiftrt)
     {
-      *pbitpos += shiftrt;
+      if (!*preversep ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN)
+	*pbitpos += shiftrt;
       *pbitsize -= shiftrt;
     }


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

* [gcc(refs/users/aoliva/heads/testme)] adjust shiftrt bitpos for endianness
@ 2020-09-17 11:31 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2020-09-17 11:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4e39482a9cbd43e6e2da4035c25d573ab267e12d

commit 4e39482a9cbd43e6e2da4035c25d573ab267e12d
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Sep 17 08:29:24 2020 -0300

    adjust shiftrt bitpos for endianness

Diff:
---
 gcc/fold-const.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c835327dac9..3f8f54a7f49 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4686,7 +4686,7 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
   if ((inner == exp && and_mask == 0)
       || !poly_bitsize.is_constant (pbitsize)
       || !poly_bitpos.is_constant (pbitpos)
-      || *pbitsize < shiftrt
+      || *pbitsize <= shiftrt
       || offset != 0
       || TREE_CODE (inner) == PLACEHOLDER_EXPR
       /* Reject out-of-bound accesses (PR79731).  */
@@ -4697,7 +4697,8 @@ decode_field_reference (location_t loc, tree *exp_, HOST_WIDE_INT *pbitsize,
 
   if (shiftrt)
     {
-      *pbitpos += shiftrt;
+      if (!lr_reversep ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN)
+	*pbitpos += shiftrt;
       *pbitsize -= shiftrt;
     }


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

end of thread, other threads:[~2020-09-23 23:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 23:23 [gcc(refs/users/aoliva/heads/testme)] adjust shiftrt bitpos for endianness Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2020-09-17 11:43 Alexandre Oliva
2020-09-17 11:31 Alexandre Oliva

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