Re: V3 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-21 Thread H.J. Lu
On Mon, Jan 21, 2019 at 4:57 AM Maxim Kuvyrkov wrote: > > Hi H.J., > > I've bisected compiler crash on building linux kernel for ARM down to this > commit. Search for > == > fs/ntfs/super.c:597:3: internal compiler error: Segmentation fault > == > in > https://ci.linaro.org/view/tcwg_kernel-gnu

Re: V3 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-21 Thread Maxim Kuvyrkov
Hi H.J., I've bisected compiler crash on building linux kernel for ARM down to this commit. Search for == fs/ntfs/super.c:597:3: internal compiler error: Segmentation fault == in https://ci.linaro.org/view/tcwg_kernel-gnu/job/tcwg_kernel-build-gnu-master-arm-mainline-defconfig/285/artifact/arti

Re: V3 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-18 Thread Jakub Jelinek
On Thu, Jan 17, 2019 at 04:00:47PM -0800, H.J. Lu wrote: > gcc/c-family/ > > PR c/51628 > PR c/88664 > * c-common.h (warn_for_address_or_pointer_of_packed_member): > Remove the boolean argument. > * c-warn.c (check_address_of_packed_member): Renamed to ... > (ch

V3 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-17 Thread H.J. Lu
move the > > while (TREE_CODE (rhs) == COMPOUND_EXPR) > >rhs = TREE_OPERAND (rhs, 1); > > > > before the if (TREE_CODE (rhs) == COND_EXPR) check and stick another > > STRIP_NOPS in between. > > Fixed. > > > > @@ -2795,58 +2862,5 @@ warn_for

V2 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-17 Thread H.J. Lu
hs) == COND_EXPR) check and stick another > STRIP_NOPS in between. Fixed. > > @@ -2795,58 +2862,5 @@ warn_for_address_or_pointer_of_packed_member (bool > > convert_p, tree type, > >while (TREE_CODE (rhs) == COMPOUND_EXPR) > > rhs = TREE_OPERAND (rhs, 1); &g

Re: V2 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-17 Thread Jakub Jelinek
On Wed, Jan 16, 2019 at 08:57:25PM -0800, H.J. Lu wrote: > Check unaligned pointer conversion and strip NOPS. > -check_address_of_packed_member (tree type, tree rhs) > +check_address_or_pointer_of_packed_member (tree type, tree rhs) > { >if (INDIRECT_REF_P (rhs)) > rhs = TREE_OPERAND (rh

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-17 Thread H.J. Lu
On Wed, Jan 16, 2019 at 3:09 PM Jakub Jelinek wrote: > > On Mon, Jan 14, 2019 at 03:23:07PM -0800, H.J. Lu wrote: > > There are no regressions with this patch: > > > > https://gcc.gnu.org/ml/gcc-patches/2019-01/msg00792.html > > As the patch seems to be a step forward and fixes an important regres

Re: V2 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-17 Thread H.J. Lu
On Wed, Jan 16, 2019 at 8:57 PM H.J. Lu wrote: > > On Wed, Jan 16, 2019 at 01:28:26PM +0100, Jakub Jelinek wrote: > > On Wed, Jan 16, 2019 at 04:11:44AM -0800, H.J. Lu wrote: > > > > Why? What is so special about C and (implicit?) casts where the rhs > > > > isn't > > > > ADDR_EXPR? Aren't all

V2 [PATCH] c-family: Update unaligned adress of packed member check

2019-01-16 Thread H.J. Lu
On Wed, Jan 16, 2019 at 01:28:26PM +0100, Jakub Jelinek wrote: > On Wed, Jan 16, 2019 at 04:11:44AM -0800, H.J. Lu wrote: > > > Why? What is so special about C and (implicit?) casts where the rhs isn't > > > ADDR_EXPR? Aren't all casts (explicit or implicit) from one pointer type > > > to another

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-16 Thread Jakub Jelinek
On Mon, Jan 14, 2019 at 03:23:07PM -0800, H.J. Lu wrote: > There are no regressions with this patch: > > https://gcc.gnu.org/ml/gcc-patches/2019-01/msg00792.html As the patch seems to be a step forward and fixes an important regression, the patch is ok for trunk, but I'd like to keep discussions

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-16 Thread Jakub Jelinek
On Wed, Jan 16, 2019 at 04:11:44AM -0800, H.J. Lu wrote: > > Why? What is so special about C and (implicit?) casts where the rhs isn't > > ADDR_EXPR? Aren't all casts (explicit or implicit) from one pointer type > > to another pointer and satisfy the rules something that should be warned > > -Wi

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-16 Thread H.J. Lu
On Wed, Jan 16, 2019 at 3:30 AM Jakub Jelinek wrote: > > On Mon, Jan 14, 2019 at 10:00:11AM -0800, H.J. Lu wrote: > > On Mon, Jan 14, 2019 at 6:22 AM Jakub Jelinek wrote: > > > > > > On Sun, Jan 13, 2019 at 06:54:05AM -0800, H.J. Lu wrote: > > > > > What always matters is whether we take address

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-16 Thread Jakub Jelinek
On Mon, Jan 14, 2019 at 10:00:11AM -0800, H.J. Lu wrote: > On Mon, Jan 14, 2019 at 6:22 AM Jakub Jelinek wrote: > > > > On Sun, Jan 13, 2019 at 06:54:05AM -0800, H.J. Lu wrote: > > > > What always matters is whether we take address of a packed structure > > > > field/non-static data member or whet

Re: [PATCH] c-family: Update unaligned adress of packed member check

2019-01-14 Thread H.J. Lu
On Mon, Jan 14, 2019 at 10:00 AM H.J. Lu wrote: > > On Mon, Jan 14, 2019 at 6:22 AM Jakub Jelinek wrote: > > > > On Sun, Jan 13, 2019 at 06:54:05AM -0800, H.J. Lu wrote: > > > > What always matters is whether we take address of a packed structure > > > > field/non-static data member or whether we

[PATCH] c-family: Update unaligned adress of packed member check

2019-01-14 Thread H.J. Lu
inter -> pointer > conversion warning somewhere else (wherever we detect a pointer to pointer > conversion, even in the middle of expression?), or do it wherever you do > currently, but again always if the orig_rhs and type pointer types are > different. > When convert_p is tru